/** * kick start the View, which creates the response * based on our previously set content data. * finally echo the response or overwrite this method * and do something else with it. * @return string */ public function afterroute() { if (!$this->response) { trigger_error('No View has been set.'); } echo $this->response->render(); }
public function index(\Base $f3, $params) { $this->response->addTitle($f3->get('LN__AdminMenu_Home')); $f3->set('title_h1', $f3->get('LN__AdminMenu_Home')); switch ($this->moduleInit(@$params['module'])) { case "manual": $this->buffer(\View\Base::stub()); break; case "custompages": $this->custompages($f3, $params); break; case "news": $this->news($f3, $params); break; case "modules": $this->buffer(\View\Base::stub()); break; case "shoutbox": $this->shoutbox($f3, $params); break; case "home": $this->home($f3); break; default: $this->buffer(\Template::instance()->render('access.html')); } }
/** * create and return response content * @return mixed */ public function __construct() { $f3 = \Base::instance(); $UI = $f3->get('UI'); // develop $tpl = 'default'; $folder = file_exists($UI . $tpl . '/layout.html') ? $tpl : 'default'; $f3->set('UI', "{$UI}{$folder}/"); $f3->set('SELF', rawurlencode($_SERVER["QUERY_STRING"])); \View\Base::javascript('body', TRUE, 'global.js'); \View\Base::javascript('body', FALSE, "var base='{$f3->get('BASE')}'"); }
public function __construct(array $aParams) { parent::__construct($aParams); $this->model = new Readout(); $this->externalModel = new OpenWeatherMap(); switch ($aParams['range']) { case 'year': $this->internalData = $this->model->getMonthlyAggregate(365, "ASC"); $this->externalData = $this->externalModel->getMonthlyAggregate(365, "ASC"); break; default: $this->internalData = $this->model->getDayAggregate(30, "ASC"); $this->externalData = $this->externalModel->getDayAggregate(30, "ASC"); break; } }
public function __construct(array $aParams) { parent::__construct($aParams); $this->model = new \Model\Readout(); }
/** * Connect to the controller and run our action. * * @return void **/ private function _connect($class_path, $action, $parameters) { $parts = explode("/", $class_path); $controller = array_pop($parts); if (!isset($action) || empty($action)) { $action = "index"; } Components\Registry::instance()->controller = $controller; Components\Registry::instance()->action = $action; Components\Registry::instance()->view = $class_path . "/" . $action; $file_path = $class_path . "_controller.php"; $class = \Inflector::camelize($controller . "_controller"); require_once 'application_controller.php'; if ($this->_find_controller($file_path)) { include_once $file_path; } else { throw new \Error("No controller found for path."); } $controller = new $class(); if (!method_exists($controller, $action)) { throw new \Error("Method '{$action}' does not exist on {$class}."); return; } $controller->params =& $parameters; $controller->{$action}(); \View\Base::instance()->render(); }
protected function team(\Base $f3) { $team = $this->model->listTeam(); print_r($team); $this->buffer(\View\Base::stub()); }
protected function characters(\Base $f3, $params, $feedback) { $this->buffer(\View\Base::stub()); }
protected function home(\Base $f3) { $this->buffer(\View\Base::stub()); }
public function profile(\Base $f3, $params) { $this->response->addTitle($f3->get('LN__UserMenu_Profile')); $this->buffer(\View\Base::stub("profile")); $this->showMenu("profile"); }
public function __construct(array $aParams) { parent::__construct($aParams); $this->model = new $this->modelName(); }