1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
controller.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Engine;
4
5use Bitrix\Main\Application;
6use Bitrix\Main\Component\ParameterSigner;
7use Bitrix\Main\Config\Configuration;
8use Bitrix\Main\Diag\ExceptionHandlerFormatter;
9use Bitrix\Main\Engine\ActionFilter\FilterType;
10use Bitrix\Main\Engine\AutoWire\BinderArgumentException;
11use Bitrix\Main\Engine\AutoWire\Parameter;
12use Bitrix\Main\Engine\Contract\Controllerable;
13use Bitrix\Main\Engine\Response\Converter;
14use Bitrix\Main\Error;
15use Bitrix\Main\ErrorCollection;
16use Bitrix\Main\Errorable;
17use Bitrix\Main\ArgumentNullException;
18use Bitrix\Main\ArgumentTypeException;
19use Bitrix\Main\Context;
20use Bitrix\Main\Engine\Response\Render\Component;
21use Bitrix\Main\Engine\Response\Render\Extension;
22use Bitrix\Main\Engine\Response\Render\View;
23use Bitrix\Main\Engine\View\ViewPathResolver;
24use Bitrix\Main\Event;
25use Bitrix\Main\EventManager;
26use Bitrix\Main\EventResult;
27use Bitrix\Main\HttpResponse;
28use Bitrix\Main\Request;
29use Bitrix\Main\Response;
30use Bitrix\Main\Security\Sign\BadSignatureException;
31use Bitrix\Main\SystemException;
32use Bitrix\Main\Validation\ValidationException;
33use Bitrix\Main\Web\Uri;
34
36{
37 public const SCOPE_REST = 'rest';
38 public const SCOPE_AJAX = 'ajax';
39 public const SCOPE_CLI = 'cli';
40
41 public const EVENT_ON_BEFORE_ACTION = 'onBeforeAction';
42 public const EVENT_ON_AFTER_ACTION = 'onAfterAction';
43
44 public const ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001';
45 public const ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002';
46
47 public const EXCEPTION_UNKNOWN_ACTION = 22002;
48
52 protected $request;
55 private Action $currentAction;
56 private array $eventHandlersIds = [
57 'prefilters' => [],
58 'postfilters' => [],
59 ];
61 private $configurationOfActions = null;
63 private string $scope;
65 private $currentUser;
67 private Converter $converter;
69 private $filePath;
71 private $sourceParametersList;
72 private $unsignedParameters;
73
74
79 final public static function className(): string
80 {
81 return static::class;
82 }
83
88 public function __construct(Request $request = null)
89 {
90 $this->scope = self::SCOPE_AJAX;
91 $this->errorCollection = new ErrorCollection;
92 $this->request = $request?: Context::getCurrent()->getRequest();
93 $this->configurator = new Configurator();
94 $this->converter = Converter::toJson();
95
96 $this->init();
97 }
98
107 public function forward($controller, string $actionName, array $parameters = null)
108 {
109 if (is_string($controller))
110 {
111 $controller = new $controller;
112 }
113
115 //probably should refactor with ControllerBuilder::build
116
117 // override parameters
118 $controller->request = $this->getRequest();
119 $controller->setScope($this->getScope());
120 $controller->setCurrentUser($this->getCurrentUser() ?? CurrentUser::get());
121
122 $currentAction = $this->getCurrentAction();
123 $this->detachFilters($currentAction);
124
125 // run action
126 $result = $controller->run(
127 $actionName,
128 $parameters === null ? $this->getSourceParametersList() : [$parameters]
129 );
130
131 $this->attachFilters($currentAction);
132 $this->addErrors($controller->getErrors());
133
134 return $result;
135 }
136
142 protected function init()
143 {
144 $this->buildConfigurationOfActions();
145 }
146
150 final public function getConfigurationOfActions()
151 {
152 return $this->configurationOfActions;
153 }
154
161 final public function getModuleId()
162 {
163 return getModuleId($this->getFilePath());
164 }
165
166 private function getCurrentAction(): Action
167 {
169 }
170
171 private function setCurrentAction(Action $currentAction): self
172 {
173 $this->currentAction = $currentAction;
174
175 return $this;
176 }
177
178 final public function isLocatedUnderPsr4(): bool
179 {
180 // do not lower if probably psr4
181 $firstLetter = mb_substr(basename($this->getFilePath()), 0, 1);
182
183 return $firstLetter !== mb_strtolower($firstLetter);
184 }
185
186 final protected function getFilePath()
187 {
188 if (!$this->filePath)
189 {
190 $reflector = new \ReflectionClass($this);
191 $this->filePath = preg_replace('#[\\\/]+#', '/', $reflector->getFileName());
192 }
193
194 return $this->filePath;
195 }
196
207 final public function getActionUri(string $actionName, array $params = [], bool $absolute = false): Uri
208 {
209 if (!str_contains($this->getFilePath(), '/components/'))
210 {
211 return UrlManager::getInstance()->createByController($this, $actionName, $params, $absolute);
212 }
213
214 return UrlManager::getInstance()->createByComponentController($this, $actionName, $params, $absolute);
215 }
216
220 final public function getUnsignedParameters()
221 {
222 return $this->unsignedParameters;
223 }
224
225 final protected function processUnsignedParameters(): void
226 {
227 foreach ($this->getSourceParametersList() as $source)
228 {
229 $signedParameters = $source['signedParameters'] ?? null;
230 if (is_string($signedParameters))
231 {
232 try
233 {
234 $this->unsignedParameters = ParameterSigner::unsignParameters(
235 $this->getSaltToUnsign(),
236 $signedParameters
237 );
238 }
239 catch (BadSignatureException $exception)
240 {}
241
242 return;
243 }
244 }
245 }
246
252 protected function getSaltToUnsign()
253 {
254 foreach ($this->getSourceParametersList() as $source)
255 {
256 if (isset($source['c']) && is_string($source['c']))
257 {
258 return $source['c'];
259 }
260 }
261
262 return null;
263 }
264
268 final public function getCurrentUser(): ?CurrentUser
269 {
270 return $this->currentUser;
271 }
272
276 final public function setCurrentUser(CurrentUser $currentUser): void
277 {
278 $this->currentUser = $currentUser;
279 }
280
289 {
290 return $this->converter->process($data);
291 }
292
297 final public function listNameActions(): array
298 {
299 $actions = array_keys($this->getConfigurationOfActions());
300 $lengthSuffix = mb_strlen(self::METHOD_ACTION_SUFFIX);
301
302 $class = new \ReflectionClass($this);
303 foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method)
304 {
305 $probablySuffix = mb_substr($method->getName(), -$lengthSuffix);
306 if ($probablySuffix === self::METHOD_ACTION_SUFFIX)
307 {
308 $actions[] = mb_strtolower(mb_substr($method->getName(), 0, -$lengthSuffix));
309 }
310 }
311
312 return array_unique($actions);
313 }
314
318 public function configureActions()
319 {
320 return [];
321 }
322
326 public function getAutoWiredParameters()
327 {
328 return [];
329 }
330
335 {
336 return null;
337 }
338
342 final public function getDefaultAutoWiredParameters()
343 {
344 return [];
345 }
346
347 private function buildConfigurationOfActions(): void
348 {
349 $this->configurationOfActions = $this->configurator->getConfigurationByController($this);
350 }
351
355 final public function getRequest()
356 {
357 return $this->request;
358 }
359
363 final public function getScope()
364 {
365 return $this->scope;
366 }
367
373 final public function setScope($scope)
374 {
375 $this->scope = $scope;
376
377 return $this;
378 }
379
383 final public function getSourceParametersList()
384 {
385 return $this->sourceParametersList;
386 }
387
393 final public function setSourceParametersList($sourceParametersList)
394 {
395 $this->sourceParametersList = $sourceParametersList;
396
397 return $this;
398 }
399
407 final public function run($actionName, array $sourceParametersList)
408 {
409 $this->collectDebugInfo();
410
411 $result = null;
412
413 try
414 {
415 $this->setSourceParametersList($sourceParametersList);
417
418 $action = $this->create($actionName);
419 if (!$action)
420 {
421 throw new SystemException("Could not create action by name {$actionName}");
422 }
423 $this->setCurrentAction($action);
424
425 $this->attachFilters($action);
426
427
428 if ($this->prepareParams() &&
429 $this->processBeforeAction($action) === true &&
430 $this->triggerOnBeforeAction($action) === true)
431 {
433
434 if ($action instanceof Errorable)
435 {
436 $this->errorCollection->add($action->getErrors());
437 }
438 }
439
441 $probablyResult = $this->processAfterAction($action, $result);
442 if ($probablyResult !== null)
443 {
444 $result = $probablyResult;
445 }
446 }
447 catch (\Throwable $e)
448 {
449 $this->runProcessingThrowable($e);
450 $this->processExceptionInDebug($e);
451 }
452 finally
453 {
454 if (isset($action))
455 {
456 $this->detachFilters($action);
457 }
458 }
459
460 $this->logDebugInfo();
461
462 return $result;
463 }
464
465 protected function getActionResponse(Action $action)
466 {
467 return $action->runWithSourceParametersList();
468 }
469
470 protected function writeToLogException(\Throwable $e): void
471 {
472 $exceptionHandler = Application::getInstance()->getExceptionHandler();
473 $exceptionHandler->writeToLog($e);
474 }
475
476 private function processExceptionInDebug(\Throwable $e): void
477 {
478 if ($this->shouldWriteToLogException($e))
479 {
480 $this->writeToLogException($e);
481 }
482
483 $exceptionHandling = Configuration::getValue('exception_handling');
484 if (!empty($exceptionHandling['debug']))
485 {
486 $this->addError(new Error(ExceptionHandlerFormatter::format($e)));
487 if ($e->getPrevious())
488 {
489 $this->addError(new Error(ExceptionHandlerFormatter::format($e->getPrevious())));
490 }
491 }
492 }
493
494 private function shouldWriteToLogException(\Throwable $e): bool
495 {
496 if ($e instanceof BinderArgumentException)
497 {
498 return false;
499 }
500
501 if ($e instanceof SystemException && ($e->getCode() === self::EXCEPTION_UNKNOWN_ACTION))
502 {
503 return false;
504 }
505
506 return true;
507 }
508
509 final public static function getFullEventName($eventName): string
510 {
511 return static::class . '::' . $eventName;
512 }
513
518 final protected function collectDebugInfo(): void
519 {
520 }
521
527 final protected function logDebugInfo(): void
528 {
529 }
530
535 protected function prepareParams()
536 {
537 return true;
538 }
539
546 {
547 return true;
548 }
549
559 final protected function triggerOnBeforeAction(Action $action): bool
560 {
561 $event = new Event(
562 'main',
563 static::getFullEventName(static::EVENT_ON_BEFORE_ACTION),
564 [
565 'action' => $action,
566 'controller' => $this,
567 ]
568 );
569 $event->send($this);
570
571 $allow = true;
572 foreach ($event->getResults() as $eventResult)
573 {
574 if ($eventResult->getType() != EventResult::SUCCESS)
575 {
576 $handler = $eventResult->getHandler();
577 if ($handler instanceof Errorable)
578 {
579 $this->errorCollection->add($handler->getErrors());
580 }
581
582 $allow = false;
583 }
584 }
585
587
588 return $allow;
589 }
590
601 {}
602
612 {}
613
614 final protected function triggerOnAfterAction(Action $action, $result)
615 {
616 $event = new Event(
617 'main',
618 static::getFullEventName(static::EVENT_ON_AFTER_ACTION),
619 [
620 'result' => $result,
621 'action' => $action,
622 'controller' => $this,
623 ]
624 );
625 $event->send($this);
626
628
629 return $event->getParameter('result');
630 }
631
632 final public function generateActionMethodName($action): string
633 {
634 return $action . self::METHOD_ACTION_SUFFIX;
635 }
636
637 protected function create($actionName)
638 {
639 $config = $this->getActionConfig($actionName);
640
641 $methodName = $this->generateActionMethodName($actionName);
642
643 if (method_exists($this, $methodName))
644 {
645 $method = new \ReflectionMethod($this, $methodName);
646 if ($method->isPublic() && mb_strtolower($method->getName()) === mb_strtolower($methodName))
647 {
648 return new InlineAction($actionName, $this, $config);
649 }
650 }
651 else
652 {
653 if (!$config && ($this instanceof Contract\FallbackActionInterface))
654 {
655 return new FallbackAction($actionName, $this, []);
656 }
657 if (!$config)
658 {
659 throw new SystemException(
660 "Could not find description of $actionName in {$this::className()}",
661 self::EXCEPTION_UNKNOWN_ACTION
662 );
663 }
664
665 return $this->buildActionInstance($actionName, $config);
666 }
667
668 return null;
669 }
670
671 final protected function buildActionInstance($actionName, array $config): Action
672 {
673 if (isset($config['callable']))
674 {
675 $callable = $config['callable'];
676 if (!is_callable($callable))
677 {
678 throw new ArgumentTypeException('callable', 'callable');
679 }
680
681 return new ClosureAction($actionName, $this, $callable);
682 }
683
684 if (empty($config['class']))
685 {
686 throw new SystemException(
687 "Could not find class in description of {$actionName} in {$this::className()} to create instance",
688 self::EXCEPTION_UNKNOWN_ACTION
689 );
690 }
691
693 return new $config['class']($actionName, $this, $config);
694 }
695
696 final protected function existsAction($actionName): bool
697 {
698 try
699 {
700 $action = $this->create($actionName);
701 }
702 catch (SystemException $e)
703 {
704 if ($e->getCode() !== Controller::EXCEPTION_UNKNOWN_ACTION)
705 {
706 throw $e;
707 }
708 }
709
710 return isset($action);
711 }
712
717 protected function getDefaultPreFilters()
718 {
719 return [
723 ),
724 new ActionFilter\Csrf(),
725 ];
726 }
727
732 protected function getDefaultPostFilters()
733 {
734 return [];
735 }
736
747 final protected function buildFilters(array $config = null): array
748 {
749 if ($config === null)
750 {
751 $config = [];
752 }
753
754 if (!isset($config[FilterType::Prefilter->value]))
755 {
756 $config[FilterType::Prefilter->value] = $this->configurator->wrapFiltersClosure(
757 $this->getDefaultPreFilters()
758 );
759 }
760 if (!isset($config[FilterType::Postfilter->value]))
761 {
762 $config[FilterType::Postfilter->value] = $this->configurator->wrapFiltersClosure(
763 $this->getDefaultPostFilters()
764 );
765 }
766
767 $hasPostMethod = $hasCsrfCheck = false;
768 foreach ($config[FilterType::Prefilter->value] as $filter)
769 {
770 if ($filter instanceof ActionFilter\HttpMethod && $filter->containsPostMethod())
771 {
772 $hasPostMethod = true;
773 }
774 if ($filter instanceof ActionFilter\Csrf)
775 {
776 $hasCsrfCheck = true;
777 }
778 }
779
780 if ($hasPostMethod && !$hasCsrfCheck && $this->request->isPost())
781 {
782 $config[FilterType::Prefilter->value][] = new ActionFilter\Csrf;
783 }
784
785 if (!empty($config[FilterType::DisablePrefilter->value]))
786 {
787 $config[FilterType::Prefilter->value] =
788 $this->removeFilters($config[FilterType::Prefilter->value], $config[FilterType::DisablePrefilter->value]);
789 }
790
791 if (!empty($config[FilterType::DisablePostfilter->value]))
792 {
793 $config[FilterType::Postfilter->value] =
794 $this->removeFilters($config[FilterType::Postfilter->value], $config[FilterType::DisablePostfilter->value]);
795 }
796
797 if (!empty($config[FilterType::EnablePrefilter->value]))
798 {
799 $config[FilterType::Prefilter->value] =
800 $this->appendFilters($config[FilterType::Prefilter->value], $config[FilterType::EnablePrefilter->value]);
801 }
802
803 if (!empty($config[FilterType::EnablePostfilter->value]))
804 {
805 $config[FilterType::Postfilter->value] =
806 $this->appendFilters($config[FilterType::Postfilter->value], $config[FilterType::EnablePostfilter->value]);
807 }
808
809 return $config;
810 }
811
812 final protected function appendFilters(array $filters, array $filtersToAppend): array
813 {
814 return array_merge($filters, $filtersToAppend);
815 }
816
817 final protected function removeFilters(array $filters, array $filtersToRemove): array
818 {
819 $cleanedFilters = [];
820 foreach ($filters as $filter)
821 {
822 $found = false;
823 foreach ($filtersToRemove as $filterToRemove)
824 {
825 if (is_a($filter, $filterToRemove))
826 {
827 $found = true;
828 break;
829 }
830 }
831
832 if (!$found)
833 {
834 $cleanedFilters[] = $filter;
835 }
836 }
837
838 return $cleanedFilters;
839 }
840
841 final protected function attachFilters(Action $action): void
842 {
843 $modifiedConfig = $this->buildFilters(
844 $this->getActionConfig($action->getName())
845 );
846
848 foreach ($modifiedConfig[FilterType::Prefilter->value] as $filter)
849 {
851 if (!in_array($this->getScope(), $filter->listAllowedScopes(), true))
852 {
853 continue;
854 }
855
856 $filter->bindAction($action);
857
858 $this->eventHandlersIds[FilterType::Prefilter->value][] = $eventManager->addEventHandler(
859 'main',
860 static::getFullEventName(static::EVENT_ON_BEFORE_ACTION),
861 [$filter, 'onBeforeAction']
862 );
863 }
864
865 foreach ($modifiedConfig[FilterType::Postfilter->value] as $filter)
866 {
868 if (!in_array($this->getScope(), $filter->listAllowedScopes(), true))
869 {
870 continue;
871 }
872
874 $filter->bindAction($action);
875
876 $this->eventHandlersIds[FilterType::Postfilter->value][] = $eventManager->addEventHandler(
877 'main',
878 static::getFullEventName(static::EVENT_ON_AFTER_ACTION),
879 [$filter, 'onAfterAction']
880 );
881 }
882 }
883
884 final protected function detachFilters(Action $action): void
885 {
888 }
889
890 final protected function detachPreFilters(Action $action): void
891 {
893 foreach ($this->eventHandlersIds[FilterType::Prefilter->value] as $handlerId)
894 {
895 $eventManager->removeEventHandler(
896 'main',
897 static::getFullEventName(static::EVENT_ON_BEFORE_ACTION),
898 $handlerId
899 );
900 }
901
902 $this->eventHandlersIds[FilterType::Prefilter->value] = [];
903 }
904
905 final protected function detachPostFilters(Action $action): void
906 {
908 foreach ($this->eventHandlersIds[FilterType::Postfilter->value] as $handlerId)
909 {
910 $eventManager->removeEventHandler(
911 'main',
912 static::getFullEventName(static::EVENT_ON_AFTER_ACTION),
913 $handlerId
914 );
915 }
916
917 $this->eventHandlersIds[FilterType::Postfilter->value] = [];
918 }
919
920 final protected function getActionConfig($actionName): ?array
921 {
922 $listOfActions = array_change_key_case($this->configurationOfActions, CASE_LOWER);
923 $actionName = mb_strtolower($actionName);
924
925 if (!isset($listOfActions[$actionName]))
926 {
927 return null;
928 }
929
930 return $listOfActions[$actionName];
931 }
932
933 final protected function setActionConfig($actionName, array $config = null): self
934 {
935 $this->configurationOfActions[$actionName] = $config;
936
937 return $this;
938 }
939
940 protected function runProcessingThrowable(\Throwable $throwable)
941 {
942 if ($throwable instanceof BinderArgumentException)
943 {
944 $this->runProcessingBinderThrowable($throwable);
945 }
946 elseif ($throwable instanceof ValidationException)
947 {
948 $this->runProcessingValidationException($throwable);
949 }
950 elseif ($throwable instanceof \Exception)
951 {
952 $this->runProcessingException($throwable);
953 }
954 elseif ($throwable instanceof \Error)
955 {
956 $this->runProcessingError($throwable);
957 }
958 }
959
965 protected function runProcessingException(\Exception $e)
966 {
967 // throw $e;
968 $this->errorCollection[] = $this->buildErrorFromException($e);
969 }
970
971 protected function runProcessingError(\Error $error)
972 {
973 // throw $error;
974 $this->errorCollection[] = $this->buildErrorFromPhpError($error);
975 }
976
978 {
979 $currentControllerErrors = $this->getErrors();
980 $errors = $e->getErrors();
981 if ($errors)
982 {
983 foreach ($errors as $error)
984 {
985 if (in_array($error, $currentControllerErrors, true))
986 {
987 continue;
988 }
989
990 $this->addError($error);
991 }
992 }
993 else
994 {
995 $this->runProcessingException($e);
996 }
997 }
998
1000 {
1001 $validationErrors = $e->getValidationErrors();
1002 if (empty($validationErrors))
1003 {
1004 $this->runProcessingException($e);
1005
1006 return;
1007 }
1008
1009 foreach ($validationErrors as $validationError)
1010 {
1011 $this->addError($validationError);
1012 }
1013 }
1014
1015 protected function buildErrorFromException(\Exception $e)
1016 {
1017 if ($e instanceof ArgumentNullException)
1018 {
1019 return new Error($e->getMessage(), self::ERROR_REQUIRED_PARAMETER);
1020 }
1021
1022 return new Error($e->getMessage(), $e->getCode());
1023 }
1024
1026 {
1027 return new Error($error->getMessage(), $error->getCode());
1028 }
1029
1035 {
1036 $this->addError(new Error('User is not authorized'));
1037
1038 throw new SystemException('User is not authorized');
1039 }
1040
1046 {
1047 $this->addError(new Error('Invalid csrf token'));
1048
1049 throw new SystemException('Invalid csrf token');
1050 }
1051
1059 public function redirectTo($url): HttpResponse
1060 {
1061 return Context::getCurrent()->getResponse()->redirectTo($url);
1062 }
1063
1070 protected function addError(Error $error)
1071 {
1072 $this->errorCollection[] = $error;
1073
1074 return $this;
1075 }
1076
1083 protected function addErrors(array $errors)
1084 {
1085 $this->errorCollection->add($errors);
1086
1087 return $this;
1088 }
1089
1094 final public function getErrors()
1095 {
1096 return $this->errorCollection->toArray();
1097 }
1098
1099 public function hasErrors(): bool
1100 {
1101 return !$this->errorCollection->isEmpty();
1102 }
1103
1109 final public function getErrorByCode($code)
1110 {
1111 return $this->errorCollection->getErrorByCode($code);
1112 }
1113
1136 final protected function renderComponent(string $name, string $template = '', array $params = [], bool $withSiteTemplate = true): Component
1137 {
1138 return new Component(
1139 $name,
1140 $template,
1141 $params,
1142 $withSiteTemplate,
1143 );
1144 }
1145
1191 final protected function renderView(string $viewPath, array $params = [], bool $withSiteTemplate = true): View
1192 {
1193 $resolver = new ViewPathResolver(
1194 $viewPath,
1195 'renderView',
1196 );
1197
1198 return new View(
1199 $resolver->resolve(),
1200 $params,
1201 $withSiteTemplate
1202 );
1203 }
1204
1216 final protected function renderExtension(string $extension, array $params = [], bool $withSiteTemplate = true): Extension
1217 {
1218 return new Extension(
1219 $extension,
1220 $params,
1221 $withSiteTemplate,
1222 );
1223 }
1224}
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
static getInstance()
Определения application.php:98
static format($exception, $htmlMode=false, $level=0)
Определения exceptionhandlerformatter.php:20
buildFilters(array $config=null)
Определения controller.php:747
const SCOPE_AJAX
Определения controller.php:38
addError(Error $error)
Определения controller.php:1070
runProcessingThrowable(\Throwable $throwable)
Определения controller.php:940
getDefaultPostFilters()
Определения controller.php:732
getAutoWiredParameters()
Определения controller.php:326
runProcessingIfUserNotAuthorized()
Определения controller.php:1034
processAfterAction(Action $action, $result)
Определения controller.php:600
buildActionInstance($actionName, array $config)
Определения controller.php:671
const EVENT_ON_BEFORE_ACTION
Определения controller.php:41
convertKeysToCamelCase($data)
Определения controller.php:288
addErrors(array $errors)
Определения controller.php:1083
const ERROR_REQUIRED_PARAMETER
Определения controller.php:44
processUnsignedParameters()
Определения controller.php:225
setSourceParametersList($sourceParametersList)
Определения controller.php:393
setScope($scope)
Определения controller.php:373
renderComponent(string $name, string $template='', array $params=[], bool $withSiteTemplate=true)
Определения controller.php:1136
create($actionName)
Определения controller.php:637
runProcessingValidationException(ValidationException $e)
Определения controller.php:999
const ERROR_UNKNOWN_ACTION
Определения controller.php:45
runProcessingException(\Exception $e)
Определения controller.php:965
getPrimaryAutoWiredParameter()
Определения controller.php:334
appendFilters(array $filters, array $filtersToAppend)
Определения controller.php:812
const EXCEPTION_UNKNOWN_ACTION
Определения controller.php:47
detachFilters(Action $action)
Определения controller.php:884
__construct(Request $request=null)
Определения controller.php:88
processBeforeAction(Action $action)
Определения controller.php:545
getActionConfig($actionName)
Определения controller.php:920
renderExtension(string $extension, array $params=[], bool $withSiteTemplate=true)
Определения controller.php:1216
getActionResponse(Action $action)
Определения controller.php:465
finalizeResponse(Response $response)
Определения controller.php:611
triggerOnBeforeAction(Action $action)
Определения controller.php:559
renderView(string $viewPath, array $params=[], bool $withSiteTemplate=true)
Определения controller.php:1191
runProcessingBinderThrowable(BinderArgumentException $e)
Определения controller.php:977
runProcessingIfInvalidCsrfToken()
Определения controller.php:1045
generateActionMethodName($action)
Определения controller.php:632
const EVENT_ON_AFTER_ACTION
Определения controller.php:42
buildErrorFromPhpError(\Error $error)
Определения controller.php:1025
const SCOPE_CLI
Определения controller.php:39
getSourceParametersList()
Определения controller.php:383
detachPreFilters(Action $action)
Определения controller.php:890
forward($controller, string $actionName, array $parameters=null)
Определения controller.php:107
runProcessingError(\Error $error)
Определения controller.php:971
static getFullEventName($eventName)
Определения controller.php:509
getActionUri(string $actionName, array $params=[], bool $absolute=false)
Определения controller.php:207
getUnsignedParameters()
Определения controller.php:220
getDefaultAutoWiredParameters()
Определения controller.php:342
run($actionName, array $sourceParametersList)
Определения controller.php:407
getConfigurationOfActions()
Определения controller.php:150
const SCOPE_REST
Определения controller.php:37
getErrorByCode($code)
Определения controller.php:1109
setActionConfig($actionName, array $config=null)
Определения controller.php:933
buildErrorFromException(\Exception $e)
Определения controller.php:1015
triggerOnAfterAction(Action $action, $result)
Определения controller.php:614
existsAction($actionName)
Определения controller.php:696
setCurrentUser(CurrentUser $currentUser)
Определения controller.php:276
static className()
Определения controller.php:79
detachPostFilters(Action $action)
Определения controller.php:905
removeFilters(array $filters, array $filtersToRemove)
Определения controller.php:817
Configurator $configurator
Определения controller.php:54
writeToLogException(\Throwable $e)
Определения controller.php:470
static get()
Определения currentuser.php:33
static getInstance()
Определения urlmanager.php:28
Определения error.php:15
Определения event.php:5
static getInstance()
Определения eventmanager.php:31
redirectTo($url)
Определения httpresponse.php:341
Определения request.php:10
Определения uri.php:17
$data['IS_AVAILABLE']
Определения .description.php:13
$template
Определения file_edit.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$currentAction
Определения options.php:52
$errors
Определения iblock_catalog_edit.php:74
$filter
Определения iblock_catalog_list.php:54
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$name
Определения menu_edit.php:35
getErrors()
Определения errorableimplementation.php:34
$event
Определения prolog_after.php:141
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393
$config
Определения quickway.php:69
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799
$response
Определения result.php:21
$method
Определения index.php:27
$eventManager
Определения include.php:412
$error
Определения subscription_card_product.php:20
$action
Определения file_dialog.php:21
$url
Определения iframe.php:7