• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/engine/controller.php
  • Класс: BitrixMainEngineController
  • Вызов: Controller::buildActionInstance
protected function buildActionInstance($actionName, array $config): Action
{
	if (isset($config['callable']))
	{
		$callable = $config['callable'];
		if (!is_callable($callable))
		{
			throw new ArgumentTypeException('callable', 'callable');
		}

		return new ClosureAction($actionName, $this, $callable);
	}

	if (empty($config['class']))
	{
		throw new SystemException(
			"Could not find class in description of {$actionName} in {$this::className()} to create instance",
			self::EXCEPTION_UNKNOWN_ACTION
		);
	}

	/** @see Action::__construct */
	return new $config['class']($actionName, $this, $config);
}