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'])); } }
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); } }