• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/engine/controller.php
  • Класс: Bitrix\Main\Engine\Controller
  • Вызов: Controller::run
public function run($actionName, array $sourceParametersList)
{
	$this->collectDebugInfo();

	$result = null;

	try
	{
		$this->setSourceParametersList($sourceParametersList);
		$this->processUnsignedParameters();

		$action = $this->create($actionName);
		if (!$action)
		{
			throw new SystemException("Could not create action by name {$actionName}");
		}
		$this->setCurrentAction($action);

		$this->attachFilters($action);
		if ($this->shouldDecodePostData($action))
		{
			$this->decodePostData();
		}

		if ($this->prepareParams() &&
			$this->processBeforeAction($action) === true &&
			$this->triggerOnBeforeAction($action) === true)
		{
			$result = $action->runWithSourceParametersList();

			if ($action instanceof Errorable)
			{
				$this->errorCollection->add($action->getErrors());
			}
		}

		$result = $this->triggerOnAfterAction($action, $result);
		$probablyResult = $this->processAfterAction($action, $result);
		if ($probablyResult !== null)
		{
			$result = $probablyResult;
		}
	}
	catch (\Throwable $e)
	{
		$this->runProcessingThrowable($e);
		$this->processExceptionInDebug($e);
	}
	finally
	{
		if (isset($action))
		{
			$this->detachFilters($action);
		}
	}

	$this->logDebugInfo();

	return $result;
}