本文整理汇总了PHP中HomeController::run方法的典型用法代码示例。如果您正苦于以下问题:PHP HomeController::run方法的具体用法?PHP HomeController::run怎么用?PHP HomeController::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HomeController
的用法示例。
在下文中一共展示了HomeController::run方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: runModule
private function runModule()
{
switch ($this->sModule) {
case "Home":
$oController = new HomeController();
$oController->run($this->sAction, $this->asArgs, $this->sView);
break;
case "ShowRoom":
$oController = new ShowRoomController();
$oController->run($this->sAction, $this->asArgs, $this->sView);
break;
case "Basic":
$oController = new BasicController();
$oController->run($this->sAction, $this->asArgs, $this->sView);
break;
case "Products":
$oController = new ProdutosController();
$oController->run($this->sAction, $this->asArgs, $this->sView);
break;
default:
echo "Erro: Módulo não existe";
}
/* switch ( $this->sModule ) */
}
示例2: HomeController
$controller .= "Controller";
if (class_exists($controller)) {
$page = new $controller();
$action = str_replace(chr(0), '', $_GET['action']);
if (method_exists($page, $action)) {
$homepage = false;
$page->run($action);
$fail = false;
}
}
if ($fail) {
throw new Error404('Action not found');
}
} else {
// We didn't render an action, let's render the index
$page = new HomeController();
$page->run('index');
//$page = new EventController();
//$page->run('coverage', 'epic13');
}
} catch (WebException $e) {
$e->notify();
$e->render();
} catch (Exception $e) {
Email::send_exception_email($e);
$newError = new Error500('An unexpected error occurred');
$newError->render();
}
?>