本文整理汇总了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";
}
示例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()) {