9 public static function build(
string $controllerClass, $options):
Controller
16 $reflectionClass = new \ReflectionClass($controllerClass);
17 if ($reflectionClass->isAbstract())
24 throw new ObjectException(
"Controller class should be subclass of \Bitrix\Main\Engine\Controller.");
30 $controller = $reflectionClass->newInstance();
31 $controller->setScope($scope);
32 $controller->setCurrentUser($currentUser);
36 catch (\ReflectionException $exception)
38 throw new ObjectException(
"Unable to construct controller {{$controllerClass}}.", $exception);