require_once('page_header.php'); require_once('page_footer.php');
Chciałbym, aby można było zmieniać styl przez panel i stąd moje pytanie - czy dobrze kombinuję, a jeśli nie - co proponujecie?
require_once('page_header.php'); require_once('page_footer.php');
<?php class template{ private $file = ''; function __construct(){ $this->load = false; } function load($file){ $this->file = HTML.''.$file; return $this->load = true; } else{ return false; } } function display(){ foreach($this->variable as $key => $value){ $$key = $value; } include(HTML.'index.php'); } function loadfile(){ if($this->load){ return $this->file; } else{ return 'error_nofile.php'; } } function __set($key, $value){ $this->variable[$key] = $value; } function __get($key){ return $this->variable[$key]; } } ?>
<!DOCTYPE HTML> <html> <head> <meta charset="UTF-8" /> <title><?= $pagetitle ?></title> </head> <body> <div id="main"> <div id="header"> [...] </div> <?php include($this->loadfile()); ?> <div id="footer"> [...] </div> </div> </body> </html>
<div id="menu"> [tu menu...] </div> <div id="articles"> <?= $news ?> </div>