本文整理匯總了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();
}
?>