當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CComponentEngine::setResolveCallback方法代碼示例

本文整理匯總了PHP中CComponentEngine::setResolveCallback方法的典型用法代碼示例。如果您正苦於以下問題:PHP CComponentEngine::setResolveCallback方法的具體用法?PHP CComponentEngine::setResolveCallback怎麽用?PHP CComponentEngine::setResolveCallback使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CComponentEngine的用法示例。


在下文中一共展示了CComponentEngine::setResolveCallback方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

    }
}
$arCustomPagesPath = array();
if ($arParams["SEF_MODE"] == "Y") {
    $arVariables = array();
    $events = GetModuleEvents("socialnetwork", "OnParseSocNetComponentPath");
    while ($arEvent = $events->Fetch()) {
        ExecuteModuleEventEx($arEvent, array(&$arDefaultUrlTemplates404, &$arCustomPagesPath, $arParams));
    }
    $engine = new CComponentEngine($this);
    if ($diskEnabled) {
        $engine->addGreedyPart("#PATH#");
        $engine->addGreedyPart("#FILE_PATH#");
        $engine->addGreedyPart("#TRASH_PATH#");
        $engine->addGreedyPart("#TRASH_FILE_PATH#");
        $engine->setResolveCallback(array(\Bitrix\Disk\Driver::getInstance()->getUrlManager(), "resolveSocNetPathComponentEngine"));
    }
    $arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates404, $arParams["SEF_URL_TEMPLATES"]);
    /* This code is needed to use short paths in WebDAV */
    $arUrlTemplates["group_files_short"] = str_replace("#path#", $arDefaultUrlTemplates404["group_files_short"], $arUrlTemplates["group_files"]);
    /* / This code is needed to use short paths in WebDAV */
    $arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases404, $arParams["VARIABLE_ALIASES"]);
    $componentPage = $engine->guessComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
    //	$componentPage = CComponentEngine::ParseComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
    if (array_key_exists($arVariables["page"], $arDefaultUrlTemplates404)) {
        $componentPage = $arVariables["page"];
    }
    if (empty($componentPage) || !array_key_exists($componentPage, $arDefaultUrlTemplates404)) {
        //if (strlen($componentPage) <= 0)
        $componentPage = "index";
    }
開發者ID:vim84,項目名稱:b-markt,代碼行數:31,代碼來源:component.php

示例2: while

        } else {
            $rsSections->SetUrlTemplates("", $arParams["SEF_BASE_URL"] . $arParams["SECTION_PAGE_URL"]);
        }
        while ($arSection = $rsSections->GetNext()) {
            $arResult["SECTIONS"][] = array("ID" => $arSection["ID"], "DEPTH_LEVEL" => $arSection["DEPTH_LEVEL"], "~NAME" => $arSection["~NAME"], "~SECTION_PAGE_URL" => $arSection["~SECTION_PAGE_URL"]);
            $arResult["ELEMENT_LINKS"][$arSection["ID"]] = array();
        }
        $this->EndResultCache();
    }
}
//In "SEF" mode we'll try to parse URL and get ELEMENT_ID from it
if ($arParams["IS_SEF"] === "Y") {
    $engine = new CComponentEngine($this);
    if (CModule::IncludeModule('iblock')) {
        $engine->addGreedyPart("#SECTION_CODE_PATH#");
        $engine->setResolveCallback(array("CIBlockFindTools", "resolveComponentEngine"));
    }
    $componentPage = $engine->guessComponentPath($arParams["SEF_BASE_URL"], array("section" => $arParams["SECTION_PAGE_URL"], "detail" => $arParams["DETAIL_PAGE_URL"]), $arVariables);
    if ($componentPage === "detail") {
        CComponentEngine::InitComponentVariables($componentPage, array("SECTION_ID", "ELEMENT_ID"), array("section" => array("SECTION_ID" => "SECTION_ID"), "detail" => array("SECTION_ID" => "SECTION_ID", "ELEMENT_ID" => "ELEMENT_ID")), $arVariables);
        $arParams["ID"] = intval($arVariables["ELEMENT_ID"]);
    }
}
if ($arParams["ID"] > 0 && intval($arVariables["SECTION_ID"]) <= 0 && CModule::IncludeModule("iblock")) {
    $arSelect = array("ID", "IBLOCK_ID", "DETAIL_PAGE_URL", "IBLOCK_SECTION_ID");
    $arFilter = array("ID" => $arParams["ID"], "ACTIVE" => "Y", "IBLOCK_ID" => $arParams["IBLOCK_ID"]);
    $rsElements = CIBlockElement::GetList(array(), $arFilter, false, false, $arSelect);
    if ($arParams["IS_SEF"] === "Y" && strlen($arParams["DETAIL_PAGE_URL"]) > 0) {
        $rsElements->SetUrlTemplates($arParams["SEF_BASE_URL"] . $arParams["DETAIL_PAGE_URL"]);
    }
    while ($arElement = $rsElements->GetNext()) {
開發者ID:rasuldev,項目名稱:torino,代碼行數:31,代碼來源:component.php


注:本文中的CComponentEngine::setResolveCallback方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。