本文整理汇总了PHP中route::ErrorPage404方法的典型用法代码示例。如果您正苦于以下问题:PHP route::ErrorPage404方法的具体用法?PHP route::ErrorPage404怎么用?PHP route::ErrorPage404使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类route
的用法示例。
在下文中一共展示了route::ErrorPage404方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: start
static function start()
{
$routes = explode('/', $_GET['router']);
if ($routes[0]) {
$controller_name = "Controller" . $routes[0];
} elseif ($routes[0] == "") {
$controller_name = "Controllerindex";
}
if ($routes[1]) {
$action_name = $routes[1];
} else {
$action_name = "index";
}
$model_name = "Model" . $routes[0];
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/apps/controler/" . mb_strtolower($controller_name) . ".php")) {
include_once $_SERVER['DOCUMENT_ROOT'] . "/apps/controler/" . mb_strtolower($controller_name) . ".php";
$controller = new $controller_name();
} else {
$controller = new Controler();
}
if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/apps/model/" . mb_strtolower($model_name) . ".php")) {
include_once $_SERVER['DOCUMENT_ROOT'] . "/apps/model/" . mb_strtolower($model_name) . ".php";
}
if (method_exists($controller, $action_name)) {
$controller->{$action_name}();
} else {
echo route::ErrorPage404();
}
}