FuelPHP Bin
Sign in
Public
PHP
Save
<?php class Controller_Main extends Controller_Template { public function before() { return parent::before(); } public function action_index() { $this->theme->set_partial('content', 'main/index'); } public function action_404() { $messages = array('Uh Oh !', 'Huh ?', 'What ?', 'Ups !'); $this->data['messages'] = $messages[array_rand($messages)]; $this->theme->set_partial('content', 'main/404')->set('data', $this->data); } 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); } }