Exemplo n.º 1
0
 public function before()
 {
     parent::before();
     if ($this->auto_render === true) {
         // Load the template
         $this->template = View::factory($this->template);
         $this->template->set('app', array('request' => $this->request, 'host_name' => $_SERVER['HTTP_HOST']));
     }
 }
Exemplo n.º 2
0
 public function before()
 {
     parent::before();
     $controller = $this->request->controller();
     $action = $this->request->action();
     $this->template = Twig::factory(strtolower($controller . '/' . $action));
     if ($this->auto_render === true) {
         /** @var Twig $engine */
         $engine = $this->engine;
         $engine::set_global('app', array('request' => $this->request, 'host_name' => $_SERVER['HTTP_HOST']));
         $engine::bind_global('styles', $this->_styles);
         $engine::bind_global('scripts', $this->_scripts);
     }
 }