當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。