Carpeta includes
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
// Requiere el header y footer
|
||||
|
||||
require_once __DIR__ . '/header.php';
|
||||
require_once __DIR__ . '/footer.php';
|
||||
|
||||
class Page {
|
||||
|
||||
private $header;
|
||||
private $footer;
|
||||
private $body = '';
|
||||
|
||||
// Setea el header y footer
|
||||
|
||||
function __construct() {
|
||||
$this->header = new Header();
|
||||
$this->footer = new Footer();
|
||||
}
|
||||
|
||||
// Setea el body obtenido por pageController
|
||||
|
||||
public function setBody($html) {
|
||||
$this->body = $html;
|
||||
}
|
||||
|
||||
// Retorna layout HTML
|
||||
|
||||
public function getHTML() {
|
||||
$page = $this->header->render();
|
||||
$page .= $this->body;
|
||||
$page .= $this->footer->render();
|
||||
return $page;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user