本文整理汇总了PHP中Index::load_page方法的典型用法代码示例。如果您正苦于以下问题:PHP Index::load_page方法的具体用法?PHP Index::load_page怎么用?PHP Index::load_page使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Index
的用法示例。
在下文中一共展示了Index::load_page方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: isset
function __construct()
{
# code...
$url = isset($_GET['q']) ? $_GET['q'] : null;
$url = rtrim($url, '/');
$url = explode('/', $url);
if (empty($url[0])) {
require 'controllers/index.php';
$controller = new Index();
$controller->LoadModel('index');
$controller->index();
return false;
}
$file = 'controllers/' . $url[0] . '.php';
if (Pages::page_exist($url[0]) == true && !isset($url[1])) {
require 'controllers/index.php';
$controller = new Index();
$controller->LoadModel('index');
$controller->load_page($url[0]);
return false;
} elseif ($url[0] == "news" && !empty($url[1])) {
require 'controllers/index.php';
$controller = new Index();
$controller->LoadModel('index');
$controller->loadNews($url[1]);
return false;
} elseif (Pages::page_exist($url[0]) == true && $url[0] != "products" && isset($url[1])) {
require 'controllers/index.php';
$controller = new Index();
$controller->LoadModel('index');
$controller->get_sub_page($url[0], $url[1]);
return false;
} elseif ($url[0] == "products" && isset($url[1])) {
require 'controllers/index.php';
$controller = new Index();
$controller->LoadModel('index');
$controller->product($url[1]);
return false;
} elseif (file_exists($file)) {
require $file;
$controller = new $url[0]();
$controller->LoadModel($url[0]);
if (isset($url[2])) {
if (method_exists($controller, $url[1])) {
$controller->{$url[1]}($url[2]);
} else {
$this->error();
}
} else {
if (isset($url[1])) {
if (method_exists($controller, $url[1])) {
$controller->{$url[1]}();
} else {
$this->error();
}
} else {
$controller->index();
}
}
} else {
$this->error();
}
}