本文整理汇总了PHP中Command::getCommands方法的典型用法代码示例。如果您正苦于以下问题:PHP Command::getCommands方法的具体用法?PHP Command::getCommands怎么用?PHP Command::getCommands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Command
的用法示例。
在下文中一共展示了Command::getCommands方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* ページを表示する。
*
* @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);
}
示例2: run
/**
* 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);
}
}
示例3: run
/**
* アプリケーションの実行。
*/
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);
}
}