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