当前位置: 首页>>代码示例>>PHP>>正文


PHP BigTree::route方法代码示例

本文整理汇总了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)) {
开发者ID:matthisamoto,项目名称:Graphfan,代码行数:31,代码来源:router.php

示例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 = "";
开发者ID:kalle0045,项目名称:BigTree-CMS,代码行数:31,代码来源:router.php


注:本文中的BigTree::route方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。