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


PHP CComponentEngine::MakeComponentUrlTemplates方法代码示例

本文整理汇总了PHP中CComponentEngine::MakeComponentUrlTemplates方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponentEngine::MakeComponentUrlTemplates方法的具体用法?PHP CComponentEngine::MakeComponentUrlTemplates怎么用?PHP CComponentEngine::MakeComponentUrlTemplates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComponentEngine的用法示例。


在下文中一共展示了CComponentEngine::MakeComponentUrlTemplates方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setPage

 /**
  * Set type of the page
  */
 protected function setPage()
 {
     $urlTemplates = [];
     if ($this->arParams['SEF_MODE'] === 'Y') {
         $variables = [];
         $urlTemplates = \CComponentEngine::MakeComponentUrlTemplates($this->defaultUrlTemplates404, $this->arParams['SEF_URL_TEMPLATES']);
         $variableAliases = \CComponentEngine::MakeComponentVariableAliases($this->defaultUrlTemplates404, $this->arParams['VARIABLE_ALIASES']);
         $this->templatePage = \CComponentEngine::ParseComponentPath($this->arParams['SEF_FOLDER'], $urlTemplates, $variables);
         if (!$this->templatePage) {
             if ($this->arParams['SET_404'] === 'Y') {
                 $folder404 = str_replace('\\', '/', $this->arParams['SEF_FOLDER']);
                 if ($folder404 != '/') {
                     $folder404 = '/' . trim($folder404, "/ \t\n\r\v") . "/";
                 }
                 if (substr($folder404, -1) == '/') {
                     $folder404 .= 'index.php';
                 }
                 if ($folder404 != Main\Context::getCurrent()->getRequest()->getRequestedPage()) {
                     $this->return404();
                 }
             }
             $this->templatePage = $this->defaultSefPage;
         }
         if ($this->isSearchRequest() && $this->arParams['USE_SEARCH'] === 'Y') {
             $this->templatePage = 'search';
         }
         \CComponentEngine::InitComponentVariables($this->templatePage, $this->componentVariables, $variableAliases, $variables);
     } else {
         $this->templatePage = $this->defaultPage;
     }
     $this->sefFolder = $this->arParams['SEF_FOLDER'];
     $this->urlTemplates = $urlTemplates;
     $this->variables = $variables;
     $this->variableAliases = $variableAliases;
 }
开发者ID:lithium-li,项目名称:bbc-module,代码行数:38,代码来源:basisrouter.php

示例2: getResult

 /**
  * получение результатов
  */
 protected function getResult()
 {
     $urlTemplates = array();
     if ($this->arParams['SEF_MODE'] == 'Y') {
         $variables = array();
         $urlTemplates = \CComponentEngine::MakeComponentUrlTemplates($this->defaultUrlTemplates404, $this->arParams['SEF_URL_TEMPLATES']);
         $variableAliases = \CComponentEngine::MakeComponentVariableAliases($this->defaultUrlTemplates404, $this->arParams['VARIABLE_ALIASES']);
         $this->page = \CComponentEngine::ParseComponentPath($this->arParams['SEF_FOLDER'], $urlTemplates, $variables);
         if (strlen($this->page) <= 0) {
             $this->page = 'index';
         }
         \CComponentEngine::InitComponentVariables($this->page, $this->componentVariables, $variableAliases, $variables);
     } else {
         $this->page = 'index';
     }
     $this->arResult = array('FOLDER' => $this->arParams['SEF_FOLDER'], 'URL_TEMPLATES' => $urlTemplates, 'VARIABLES' => $variables, 'ALIASES' => $variableAliases);
 }
开发者ID:belukov,项目名称:bx-components,代码行数:20,代码来源:class.php

示例3: array

<?php

if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
    die;
}
$arDefaultUrlTemplates404 = array("list" => "profile_list.php", "detail" => "profile_detail.php?ID=#ID#");
$arDefaultVariableAliases404 = array();
$arDefaultVariableAliases = array();
$arComponentVariables = array("ID", "del_id");
$componentPage = "";
$arVariables = array();
$this->setFramemode(false);
if ($arParams["SEF_MODE"] == "Y") {
    $arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates404, $arParams["SEF_URL_TEMPLATES"]);
    $arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases404, $arParams["VARIABLE_ALIASES"]);
    $componentPage = CComponentEngine::ParseComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
    CComponentEngine::InitComponentVariables($componentPage, $arComponentVariables, $arVariableAliases, $arVariables);
    foreach ($arUrlTemplates as $url => $value) {
        $arResult["PATH_TO_" . ToUpper($url)] = $arParams["SEF_FOLDER"] . $value;
    }
    if ($componentPage != "detail") {
        $componentPage = "list";
    }
    $arResult = array_merge(array("SEF_FOLDER" => $arParams["SEF_FOLDER"], "URL_TEMPLATES" => $arUrlTemplates, "VARIABLES" => $arVariables, "ALIASES" => $arVariableAliases), $arResult);
} else {
    $arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases404, $arParams["VARIABLE_ALIASES"]);
    CComponentEngine::InitComponentVariables(false, $arComponentVariables, $arVariableAliases, $arVariables);
    if (IntVal($_REQUEST["ID"]) > 0) {
        $componentPage = "detail";
    } else {
        $componentPage = "list";
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:31,代码来源:component.php

示例4: Array

<?
if(!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED!==true) die();

$arDefaultVariableAliases = Array(
	"album_id" => "album_id", 
	"photo_id" => "photo_id", 
);

if($arParams["SEF_MODE"] == "Y")
{
	$arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates(array(), $arParams["SEF_URL_TEMPLATES"]);
	$arVariableAliases = CComponentEngine::MakeComponentVariableAliases(array(), $arParams["VARIABLE_ALIASES"]);
	$componentPage = CComponentEngine::ParseComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
	CComponentEngine::InitComponentVariables($componentPage, $arComponentVariables, $arVariableAliases, $arVariables);
	$arResult = array(
		"FOLDER" => $arParams["SEF_FOLDER"],
		"URL_TEMPLATES" => $arUrlTemplates, 
		"VARIABLES" => $arVariables, 
		"ALIASES" => $arVariableAliases
	);

}
else
{
	$arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases, $arParams["VARIABLE_ALIASES"]);
	CComponentEngine::InitComponentVariables(false, $arComponentVariables, $arVariableAliases, $arVariables);

	$componentPage = "";

	if(isset($arVariables["album_id"]) && intval($arVariables["album_id"]) > 0) {
		$componentPage = "album";
开发者ID:ASDAFF,项目名称:bitrix-yandexfotki,代码行数:31,代码来源:component.php

示例5: array

    }
    $arParams['STORAGE'] = \Bitrix\Disk\Storage::loadById((int) $arParams['STORAGE_ID'], array('ROOT_OBJECT'));
}
if (empty($arParams['STORAGE'])) {
    //necessary
    return;
}
if ($arParams['SEF_MODE'] == 'Y') {
    $arVariables = array();
    $engine = new CComponentEngine($this);
    $engine->addGreedyPart("#PATH#");
    $engine->addGreedyPart("#FILE_PATH#");
    $engine->addGreedyPart("#TRASH_PATH#");
    $engine->addGreedyPart("#TRASH_FILE_PATH#");
    $engine->setResolveCallback(array(\Bitrix\Disk\Driver::getInstance()->getUrlManager(), "resolvePathComponentEngine"));
    $arUrlTemplates = CComponentEngine::MakeComponentUrlTemplates($arDefaultUrlTemplates404, isset($arParams["SEF_URL_TEMPLATES"]) ? $arParams["SEF_URL_TEMPLATES"] : array());
    $arVariableAliases = CComponentEngine::MakeComponentVariableAliases($arDefaultVariableAliases404, isset($arParams["VARIABLE_ALIASES"]) ? $arParams["VARIABLE_ALIASES"] : array());
    $componentPage = $engine->guessComponentPath($arParams["SEF_FOLDER"], $arUrlTemplates, $arVariables);
    if (empty($componentPage) || !array_key_exists($componentPage, $arDefaultUrlTemplates404)) {
        /** @var \Bitrix\Disk\Storage $arParams['STORAGE'] */
        $componentPage = 'folder_list';
        if ($arParams['STORAGE'] instanceof \Bitrix\Disk\Storage) {
            $arVariables = array('STORAGE' => $arParams['STORAGE'], 'FOLDER_ID' => $arParams['STORAGE']->getRootObjectId(), 'RELATIVE_PATH' => '/', 'RELATIVE_ITEMS' => array());
        }
    }
    CComponentEngine::InitComponentVariables($componentPage, $arComponentVariables, $arVariableAliases, $arVariables);
    $arParams['SEF_FOLDER'] = rtrim($arParams['SEF_FOLDER'], '/') . '/';
    foreach ($arUrlTemplates as $url => $value) {
        if (empty($arParams['PATH_TO_' . strtoupper($url)])) {
            $arResult['PATH_TO_' . strtoupper($url)] = $arParams['SEF_FOLDER'] . $value;
        } elseif (is_string($arParams['PATH_TO_' . strtoupper($url)])) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例6: getSEF_Settings

 /**
  * Инициализирует ЧПУ из настроек компонента
  * @return bool
  */
 protected function getSEF_Settings()
 {
     if ($this->arParams['SEF_MODE'] == 'Y') {
         $engine = new \CComponentEngine($this);
         foreach ($this->arParams['GREEDY_PARTS'] as $part) {
             $engine->addGreedyPart($part);
         }
         $this->arUrlTemplates = \CComponentEngine::MakeComponentUrlTemplates(array(), $this->arParams["SEF_URL_TEMPLATES"]);
         $this->arVariableAliases = \CComponentEngine::MakeComponentVariableAliases(array(), $this->arParams["VARIABLE_ALIASES"]);
         $this->componentRoute = $engine->guessComponentPath($this->arParams["SEF_FOLDER"], $this->arUrlTemplates, $this->arVariables);
         $this->parseGreedyPartsVariables();
         if (!$this->componentRoute) {
             if (static::isPathsEqual($this->request->getRequestedPageDirectory(), $this->arParams["SEF_FOLDER"])) {
                 $this->genCallable(true);
                 return true;
             } else {
                 return false;
             }
         } else {
             \CComponentEngine::InitComponentVariables($this->componentRoute, $this->arComponentVariables, $this->arVariableAliases, $this->arVariables);
             //переставляем переменные в том порядке, к вотором они должны попасть в функцию
             $componentParameters = $this->getComponentParameters();
             if (isset($componentParameters['PARAMETERS']['SEF_MODE'][$this->componentRoute]['VARIABLES'])) {
                 $parametersVars = $componentParameters['PARAMETERS']['SEF_MODE'][$this->componentRoute]['VARIABLES'];
                 foreach ($parametersVars as $varName) {
                     if (isset($this->arVariables[$varName])) {
                         $this->componentRouteVariables[] = $this->arVariables[$varName];
                     } else {
                         $this->componentRouteVariables[] = null;
                     }
                 }
             }
             $this->genCallable();
             return true;
         }
     } else {
         $this->genCallable(true);
         return true;
     }
 }
开发者ID:digitalwand,项目名称:mvc.base,代码行数:44,代码来源:class.php


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