<?php error_Reporting(E_ALL); require_once $server_dir . '/lib/Twig/Autoloader.php'; Twig_Autoloader::register(); class Template { private $data; private $twig; private $controller; function __construct($controller) { global $server_dir; #print "Con $controller "; $this->controller = $controller; $this->data = array(); $path = array(); foreach (classHierachy($this->controller) as $class) { if ($class != "controller" && $class != "basecontroller") { $path[] = $server_dir . '/web/' . $class . '/template/'; } } #print_r($path); $loader = new Twig_Loader_Filesystem($path); $this->twig = new Twig_Environment($loader, array('cache' => $server_dir . '/tmp/twig/cache/')); } function assign($key, $value) { $this->data[$key] = $value; } function output($file)
<?php error_Reporting(0); require_once "_inc/glob.php"; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> <title>radiPanel</title> <script type="text/javascript" src="_js/prototype.js"></script> <script type="text/javascript" src="_js/scriptaculous.js"></script> <script type="text/javascript" src="_js/validation.js"></script> <script type="text/javascript" src="_js/radi.js"></script> <style type="text/css" media="screen">@import url('_img/style.css');</style> </head> <body> <?php if ($user->loggedIn) { ?> <div style="width: 800px; margin: auto;">