FuelPHP Bin
Sign in
Url:
Fork
<?php class Controller_Theme extends \Controller { public function before(){ parent::before(); // load the theme template $this->theme = \Theme::forge(array( 'paths' => array( APPPATH.'themes'.DS.'frontend', ), 'view_ext' => '.php', 'active' => 'default', )); $this->theme->set_template('template'); $this->theme->get_template()->set('title', ''); $this->theme->get_template()->set('assets',\Uri::base().$this->theme->asset_path('assets/')); $this->theme->get_template()->set('bc' , array('Home','Dashboard')); $this->theme->get_template()->set('icon','fa-home'); $this->theme->get_template()->set('content',''); } /** * keep the after() as standard as possible to allow custom responses from actions */ public function after($response) { // If no response object was returned by the action, if (empty($response) or ! $response instanceof Response) { // render the defined template $response = \Response::forge(\Theme::instance()->render()); } return parent::after($response); } }