/** * ページを表示する。 * * @param array(string => string) $value スキンに渡す値。bodyとtitleは必須。 */ function render($value) { $command = array(); foreach (Command::getCommands() as $c) { $html = $c->getbody(); if ($html != '') { $command[substr(get_class($c), 8)] = $html; } } $plugin = array(); foreach (Plugin::getPlugins() as $c) { $html = $c->getbody(); if ($html != '') { $plugin[substr(get_class($c), 7)] = $html; } } $this->smarty->assign('command', $command); $this->smarty->assign('plugin', $plugin); $this->smarty->assign('option', $this->option); $this->smarty->assign('headeroption', $this->headeroption); $this->smarty->assign('theme', $this->theme); $this->smarty->assign($value); header('Content-Type: text/html; charset=UTF-8'); $this->smarty->assign('runningtime', sprintf('%.3f', mtime() - STARTTIME)); $this->smarty->display(SKINFILE); }
/** * Run application */ public function run() { try { // Pre settings before run controller foreach (Command::getCommands() as $cmd) { $cmd->doing(); } foreach (Plugin::getPlugins() as $plugin) { $plugin->doing(); } // Run the controller $ret = $this->controller->run(); // After run the controller foreach (Command::getCommands() as $cmd) { $cmd->done(); } foreach (Plugin::getPlugins() as $plugin) { $plugin->done(); } // Rendering Renderer::getInstance()->render($ret); } catch (MyException $exc) { $text['title'] = 'error'; $text['body'] = $exc->getMessage(); Renderer::getInstance()->render($text); } }
/** * アプリケーションの実行。 */ function run() { try { //コントローラの本体処理実行前動作 foreach (Command::getCommands() as $cmd) { $cmd->doing(); } foreach (Plugin::getPlugins() as $plugin) { $plugin->doing(); } //本体処理実行 $ret = $this->controller->run(); //コントローラの本体処理実行後動作 foreach (Command::getCommands() as $cmd) { $cmd->done(); } foreach (Plugin::getPlugins() as $plugin) { $plugin->done(); } //レンダリング Renderer::getinstance()->render($ret); } catch (MyException $exc) { $text['title'] = 'error'; $text['body'] = $exc->getMessage(); Renderer::getinstance()->render($text); } }