• Модуль: market
  • Путь к файлу: ~/bitrix/modules/market/lib/PageRules.php
  • Класс: BitrixMarketPageRules
  • Вызов: PageRules::__construct
public function __construct($requestUrl, array $queryParams)
{
	$urlVariables = [];
	$this->componentPage = CComponentEngine::ParseComponentPath(
		PageRules::MAIN_PAGE,
		PageRules::DEFAULT_URL_TEMPLATES,
		$urlVariables,
		$requestUrl
	);

	if (empty($this->componentPage)) {
		$this->componentPage = 'main';
	}

	if (isset(PageRules::COMPONENT_PARAMS[$this->componentPage])) {
		$this->componentParams = PageRules::COMPONENT_PARAMS[$this->componentPage];
	}

	if (isset(PageRules::URL_VARIABLES[$this->componentPage])) {
		$urlVariable = PageRules::URL_VARIABLES[$this->componentPage];
		if (isset($urlVariables[$urlVariable]) && !empty($urlVariables[$urlVariable])) {
			$this->componentParams = array_merge($this->componentParams, [
				PageRules::COMPONENT_VARIABLES[$this->componentPage] => $urlVariables[$urlVariable],
			]);
		}
	}

	$this->componentParams['REQUEST'] = $queryParams;

	if (empty(PageRules::COMPONENTS_CLASS[$this->componentPage])) {
		return;
	}

	CBitrixComponent::includeComponentClass(PageRules::COMPONENTS_CLASS_NAME[$this->componentPage]);

	$class = PageRules::COMPONENTS_CLASS[$this->componentPage];

	$this->classInstance = new $class();
}