• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/engine/router.php
  • Класс: BitrixMainEngineRouter
  • Вызов: Router::buildComponent
protected function buildComponent($componentName, $signedParameters = null, $template = null)
{
	$class = CBitrixComponent::includeComponentClass($componentName);
	if (!is_subclass_of($class, 'CBitrixComponent'))
	{
		return null;
	}

	$parameters = array();
	if ($signedParameters)
	{
		$parameters = ParameterSigner::unsignParameters($componentName, $signedParameters);
	}

	/** @var CBitrixComponent $component */
	$component = new $class();

	if (!($component instanceof Controllerable))
	{
		throw new SystemException(
			"The component {$this->component} must be implement interface BitrixMainEngineContractControllerable",
			self::EXCEPTION_INVALID_COMPONENT_INTERFACE
		);
	}

	$component->initComponent($componentName, $template);
	$component->onIncludeComponentLang();
	$component->arParams = $component->onPrepareComponentParams($parameters);
	$component->__prepareComponentParams($component->arParams);

	return $component;
}