本文整理汇总了PHP中BigTree::route方法的典型用法代码示例。如果您正苦于以下问题:PHP BigTree::route方法的具体用法?PHP BigTree::route怎么用?PHP BigTree::route使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigTree
的用法示例。
在下文中一共展示了BigTree::route方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: catch
$ga->cacheInformation();
} catch (Exception $e) {
// We should log this in 4.1
}
}
}
// Normal page routing.
$ispage = false;
$inc = false;
$primary_route = $bigtree["path"][1];
$module_path = array_slice($bigtree["path"], 1);
// Check custom
list($inc, $commands) = BigTree::route(SERVER_ROOT . "custom/admin/modules/", $module_path);
// Check core if we didn't find the page or if we found the page but it had commands (because we may be overriding a page earlier in the chain but using the core further down)
if (!$inc || count($commands)) {
list($core_inc, $core_commands) = BigTree::route(SERVER_ROOT . "core/admin/modules/", $module_path);
// If we either never found the custom file or if there are more routes found in the core file use the core.
if (!$inc || $inc && $core_inc && count($core_commands) < count($commands)) {
$inc = $core_inc;
$commands = $core_commands;
}
}
if (count($commands)) {
$bigtree["module_path"] = array_slice($module_path, 1, -1 * count($commands));
} else {
$bigtree["module_path"] = array_slice($module_path, 1);
}
// Check pages
if (!$inc) {
$inc = BigTree::path("admin/pages/{$primary_route}.php");
if (file_exists($inc)) {
示例2: explode
}
// If the template is a module, do its routing for it, otherwise just include the template.
if ($routed) {
// Allow the homepage to be routed
if ($bigtree["page"]["path"]) {
$path_components = explode("/", substr(implode("/", $bigtree["path"]) . "/", strlen($bigtree["page"]["path"] . "/")));
} else {
$path_components = $bigtree["path"];
}
if (end($path_components) === "") {
array_pop($path_components);
}
if ($extension) {
list($inc, $commands) = BigTree::route(SERVER_ROOT . "extensions/{$extension}/templates/routed/{$template}/", $path_components);
} else {
list($inc, $commands) = BigTree::route(SERVER_ROOT . "templates/routed/" . $bigtree["page"]["template"] . "/", $path_components);
}
$bigtree["routed_inc"] = $inc;
$bigtree["commands"] = $commands;
if (count($commands)) {
$bigtree["routed_path"] = $bigtree["module_path"] = array_slice($path_components, 0, -1 * count($commands));
} else {
$bigtree["routed_path"] = $bigtree["module_path"] = array_slice($path_components, 0);
}
// Get the pieces of the location so we can get header and footers. Take away the first 2 routes since they're templates/routed/.
$pieces = array_slice(explode("/", str_replace(SERVER_ROOT, "", $inc)), 2);
if ($extension) {
$pieces = array_slice($pieces, 2);
}
// Include all headers in the module directory in the order they occur.
$inc_path = "";