1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс Controller
Граф наследования:Controller:
Errorable Controllerable CalendarAjax CalendarEntryAjax CalendarEventViewForm LocationAjax PublicEvent ResourceBookingAjax SharingAjax SharingGroupAjax SyncAjax Entity Analytics BarcodeScanner Config Contractor Element Mode ProductForm HtmlEditorAjax Topic Call Beta Disk Revision Cookies Copilot DiskFile Landing Note User Vibe Address Format Source Agreement AuthCode Export Base LoadExt MailProviders Sender Numerator PhoneAuth PhoneNumber QrCodeAuth Rating VendorNotification Timezone UserFieldConfig ComponentController DefaultController JsonController Sender Cacherate Channel Config Token User AppForm Application Configuration Import EInvoice File Integration Admin Base Barcode BasketItem BasketProperties Controller DeliveryRequest Entity FacebookConversion Order Entity Robokassa Payment Property Shipment ShipmentItem Synchronizer Tracking Config Extension Setup Job Base Composition Switcher Promotion AuthFlow Controller Mask FileUploader InfoHelper Manual

Открытые члены

 __construct (Request $request=null)
 forward ($controller, string $actionName, array $parameters=null)
 getConfigurationOfActions ()
 getModuleId ()
 isLocatedUnderPsr4 ()
 getActionUri (string $actionName, array $params=[], bool $absolute=false)
 getUnsignedParameters ()
 getCurrentUser ()
 setCurrentUser (CurrentUser $currentUser)
 convertKeysToCamelCase ($data)
 listNameActions ()
 configureActions ()
 getAutoWiredParameters ()
 getPrimaryAutoWiredParameter ()
 getDefaultAutoWiredParameters ()
 getRequest ()
 getScope ()
 setScope ($scope)
 getSourceParametersList ()
 setSourceParametersList ($sourceParametersList)
 run ($actionName, array $sourceParametersList)
 finalizeResponse (Response $response)
 generateActionMethodName ($action)
 redirectTo ($url)
 getErrors ()
 hasErrors ()
 getErrorByCode ($code)

Открытые статические члены

static className ()
static getFullEventName ($eventName)

Поля данных

const SCOPE_REST = 'rest'
const SCOPE_AJAX = 'ajax'
const SCOPE_CLI = 'cli'
const EVENT_ON_BEFORE_ACTION = 'onBeforeAction'
const EVENT_ON_AFTER_ACTION = 'onAfterAction'
const ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'
const ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'
const EXCEPTION_UNKNOWN_ACTION = 22002
Поля данных унаследованные от Controllerable
const METHOD_ACTION_SUFFIX = 'Action'

Защищенные члены

 init ()
 getFilePath ()
 processUnsignedParameters ()
 getSaltToUnsign ()
 getActionResponse (Action $action)
 writeToLogException (\Throwable $e)
 collectDebugInfo ()
 logDebugInfo ()
 prepareParams ()
 processBeforeAction (Action $action)
 triggerOnBeforeAction (Action $action)
 processAfterAction (Action $action, $result)
 triggerOnAfterAction (Action $action, $result)
 create ($actionName)
 buildActionInstance ($actionName, array $config)
 existsAction ($actionName)
 getDefaultPreFilters ()
 getDefaultPostFilters ()
 buildFilters (array $config=null)
 appendFilters (array $filters, array $filtersToAppend)
 removeFilters (array $filters, array $filtersToRemove)
 detachFilters (Action $action)
 detachPreFilters (Action $action)
 detachPostFilters (Action $action)
 getActionConfig ($actionName)
 setActionConfig ($actionName, array $config=null)
 runProcessingThrowable (\Throwable $throwable)
 runProcessingException (\Exception $e)
 runProcessingError (\Error $error)
 runProcessingBinderThrowable (BinderArgumentException $e)
 runProcessingValidationException (ValidationException $e)
 buildErrorFromException (\Exception $e)
 buildErrorFromPhpError (\Error $error)
 runProcessingIfUserNotAuthorized ()
 runProcessingIfInvalidCsrfToken ()
 addError (Error $error)
 addErrors (array $errors)
 renderComponent (string $name, string $template='', array $params=[], bool $withSiteTemplate=true)
 renderView (string $viewPath, array $params=[], bool $withSiteTemplate=true)
 renderExtension (string $extension, array $params=[], bool $withSiteTemplate=true)

Защищенные данные

 $errorCollection
 $request
Configurator $configurator

Подробное описание

См. определение в файле controller.php строка 35

Конструктор(ы)

◆ __construct()

__construct ( Request $request = null)

Constructor Controller.

Аргументы
Request | null$request

Переопределяется в Tracking.

См. определение в файле controller.php строка 88

Методы

◆ addError()

addError ( Error $error)
protected

Adds error to error collection.

Аргументы
Error$errorError.
Возвращает
$this

См. определение в файле controller.php строка 1070

◆ addErrors()

addErrors ( array $errors)
protected

Adds list of errors to error collection.

Аргументы
Error[]$errorsErrors.
Возвращает
$this

См. определение в файле controller.php строка 1083

◆ appendFilters()

appendFilters ( array $filters,
array $filtersToAppend )
finalprotected

См. определение в файле controller.php строка 812

◆ buildActionInstance()

buildActionInstance ( $actionName,
array $config )
finalprotected
См. также
Action::__construct

См. определение в файле controller.php строка 671

◆ buildErrorFromException()

buildErrorFromException ( \Exception $e)
protected

См. определение в файле controller.php строка 1015

◆ buildErrorFromPhpError()

buildErrorFromPhpError ( \Error $error)
protected

См. определение в файле controller.php строка 1025

◆ buildFilters()

buildFilters ( array $config = null)
finalprotected

Builds filter by config. If there is no config, then we use default filters

См. также
\Bitrix\Main\Engine\Controller::getDefaultPreFilters() and
\Bitrix\Main\Engine\Controller::getDefaultPostFilters(). If now is POST query and there is no csrf check in config, then we add it.
Аргументы
array | null$config
Возвращает
array|null

См. определение в файле controller.php строка 747

◆ className()

className ( )
staticfinal

Returns the fully qualified name of this class.

Возвращает
string

См. определение в файле controller.php строка 79

◆ collectDebugInfo()

collectDebugInfo ( )
finalprotected

Collects debug info by Diag.

Возвращает
void

См. определение в файле controller.php строка 518

◆ configureActions()

◆ convertKeysToCamelCase()

convertKeysToCamelCase ( $data)

Converts keys of array to camel case notation.

См. также
\Bitrix\Main\Engine\Response\Converter::OUTPUT_JSON_FORMAT
Аргументы
mixed$dataData.
Возвращает
array|mixed|string

См. определение в файле controller.php строка 288

◆ create()

create ( $actionName)
protected

Переопределяется в ComponentController и Base.

См. определение в файле controller.php строка 637

◆ detachFilters()

detachFilters ( Action $action)
finalprotected

См. определение в файле controller.php строка 884

◆ detachPostFilters()

detachPostFilters ( Action $action)
finalprotected

См. определение в файле controller.php строка 905

◆ detachPreFilters()

detachPreFilters ( Action $action)
finalprotected

См. определение в файле controller.php строка 890

◆ existsAction()

existsAction ( $actionName)
finalprotected

См. определение в файле controller.php строка 696

◆ finalizeResponse()

finalizeResponse ( Response $response)

Finalizes response. The method will be invoked when HttpApplication will be ready to send response to client. It's a final place where Controller can interact with response.

Аргументы
Response$response
Возвращает
void

См. определение в файле controller.php строка 611

◆ forward()

forward ( $controller,
string $actionName,
array $parameters = null )
Аргументы
Controller | string$controller
string$actionName
array | null$parameters
Возвращает
HttpResponse|mixed
Исключения
SystemException
См. также
\Bitrix\Main\Engine\ControllerBuilder::build

См. определение в файле controller.php строка 107

◆ generateActionMethodName()

generateActionMethodName ( $action)
final

См. определение в файле controller.php строка 632

◆ getActionConfig()

getActionConfig ( $actionName)
finalprotected

См. определение в файле controller.php строка 920

◆ getActionResponse()

getActionResponse ( Action $action)
protected

См. определение в файле controller.php строка 465

◆ getActionUri()

getActionUri ( string $actionName,
array $params = [],
bool $absolute = false )
final

Returns uri for ajax end point for the action name. It's a helper, which uses relative action name without controller name.

Аргументы
string$actionNameAction name. It's a relative action name without controller name.
array$paramsParameters for creating uri.
bool$absolute
Возвращает
Uri

См. определение в файле controller.php строка 207

◆ getAutoWiredParameters()

getAutoWiredParameters ( )
Возвращает
Parameter[]

Переопределяется в SharingGroupAjax, Composition, Switcher, Promotion и FileUploader.

См. определение в файле controller.php строка 326

◆ getConfigurationOfActions()

getConfigurationOfActions ( )
final
Возвращает
array|null

См. определение в файле controller.php строка 150

◆ getCurrentUser()

getCurrentUser ( )
final
Возвращает
CurrentUser

См. определение в файле controller.php строка 268

◆ getDefaultAutoWiredParameters()

getDefaultAutoWiredParameters ( )
final
Возвращает
Parameter[]

См. определение в файле controller.php строка 342

◆ getDefaultPostFilters()

getDefaultPostFilters ( )
protected

Returns default post-filters for action.

Возвращает
array

См. определение в файле controller.php строка 732

◆ getDefaultPreFilters()

getDefaultPreFilters ( )
protected

Returns default pre-filters for action.

Возвращает
array

Переопределяется в Element, Mode, ProductForm, ProductSelector, SkuTree, StoreSelector, Disk, Cookies, Copilot, DiskFile, Landing, Note, User, Vibe, Address, Format, Source, Toolbar, UserFieldConfig, UserOption, JsonController, Application, Configuration, Import, File, ConsentPreview, Base, EntitySelector, Feedback и FileUploader.

См. определение в файле controller.php строка 717

◆ getErrorByCode()

getErrorByCode ( $code)
final

Getting once error with the necessary code.

Аргументы
string$codeCode of error.
Возвращает
Error

Замещает Errorable.

См. определение в файле controller.php строка 1109

◆ getErrors()

getErrors ( )
final

Getting array of errors.

Возвращает
Error[]

Замещает Errorable.

См. определение в файле controller.php строка 1094

◆ getFilePath()

getFilePath ( )
finalprotected

См. определение в файле controller.php строка 186

◆ getFullEventName()

getFullEventName ( $eventName)
staticfinal

См. определение в файле controller.php строка 509

◆ getModuleId()

getModuleId ( )
final

Returns module id. Tries to guess module id by file path and function

См. также
getModuleId().
Возвращает
string

См. определение в файле controller.php строка 161

◆ getPrimaryAutoWiredParameter()

getPrimaryAutoWiredParameter ( )
Возвращает
Parameter|null

См. определение в файле controller.php строка 334

◆ getRequest()

getRequest ( )
final
Возвращает
\Bitrix\Main\HttpRequest

См. определение в файле controller.php строка 355

◆ getSaltToUnsign()

getSaltToUnsign ( )
protected

Tries to find salt from request. It's "c" (component name) in general.

Возвращает
string|null

См. определение в файле controller.php строка 252

◆ getScope()

getScope ( )
final
Возвращает
string

См. определение в файле controller.php строка 363

◆ getSourceParametersList()

getSourceParametersList ( )
final
Возвращает
array

См. определение в файле controller.php строка 383

◆ getUnsignedParameters()

getUnsignedParameters ( )
final
Возвращает
mixed

См. определение в файле controller.php строка 220

◆ hasErrors()

hasErrors ( )

Переопределяется в Property и Controller.

См. определение в файле controller.php строка 1099

◆ init()

init ( )
protected

Initializes controller. This method is invoked at the end of constructor.

Возвращает
void

Переопределяется в SharingAjax, ProductSelector, StoreSelector, Address, Format, Source, Export, Base, Composition, Switcher, Grabber, Csv и Csv.

См. определение в файле controller.php строка 142

◆ isLocatedUnderPsr4()

isLocatedUnderPsr4 ( )
final

См. определение в файле controller.php строка 178

◆ listNameActions()

listNameActions ( )
final

Returns list of all

Возвращает
array

См. определение в файле controller.php строка 297

◆ logDebugInfo()

logDebugInfo ( )
finalprotected

Logs debug info by Diag.

Исключения

Bitrix\Main\SystemException

Возвращает
void

См. определение в файле controller.php строка 527

◆ prepareParams()

prepareParams ( )
protected

Prepare params before process action.

Возвращает
bool

См. определение в файле controller.php строка 535

◆ processAfterAction()

processAfterAction ( Action $action,
$result )
protected

Common operations after process action. If the method returns void or null it means that we don't want to modify $result.

Аргументы
Action$action
$result
Возвращает
HttpResponse|mixed|void

Переопределяется в UserFieldConfig.

См. определение в файле controller.php строка 600

◆ processBeforeAction()

processBeforeAction ( Action $action)
protected

Common operations before process action.

Аргументы
Action$action
Возвращает
bool If method will return false, then action will not execute.

Переопределяется в Config, ProductSelector, StoreSelector, Beta, Disk, Conference и FileUploader.

См. определение в файле controller.php строка 545

◆ processUnsignedParameters()

processUnsignedParameters ( )
finalprotected

См. определение в файле controller.php строка 225

◆ redirectTo()

redirectTo ( $url)

Redirect to URL.

Аргументы
string$url
Возвращает
\Bitrix\Main\Engine\Response\Redirect

См. определение в файле controller.php строка 1059

◆ removeFilters()

removeFilters ( array $filters,
array $filtersToRemove )
finalprotected

См. определение в файле controller.php строка 817

◆ renderComponent()

renderComponent ( string $name,
string $template = '',
array $params = [],
bool $withSiteTemplate = true )
finalprotected

Returns response with component content inside site template.

Example:

public function fooAction()
{
return $this->renderComponent('bitrix:component.name', 'template-name', [
'param' => 'value',
]);
}
renderComponent(string $name, string $template='', array $params=[], bool $withSiteTemplate=true)
Определения controller.php:1136
См. также
\Bitrix\Main\Engine\Response\Render\Component
Аргументы
string$name
string$template
array$params
bool$withSiteTemplate
Возвращает
Component

См. определение в файле controller.php строка 1136

◆ renderExtension()

renderExtension ( string $extension,
array $params = [],
bool $withSiteTemplate = true )
finalprotected

Render extension. It's not SSR!

См. также
\Bitrix\Main\Engine\Response\Render\Extension
Аргументы
string$extension
array$params
bool$withSiteTemplate
Возвращает
Extension

См. определение в файле controller.php строка 1216

◆ renderView()

renderView ( string $viewPath,
array $params = [],
bool $withSiteTemplate = true )
finalprotected

Render file content.

Example:

public function fooAction()
{
return $this->renderView('testfile');
}
renderView(string $viewPath, array $params=[], bool $withSiteTemplate=true)
Определения controller.php:1191

Equivalent to:

public function fooAction()
{
return $this->renderView('/local/modules/my.module/views/testfile.php');
}

Example with params:

public function fooAction()
{
return $this->renderView('testfile', [
'id' => 123,
]);
}

Render only file content, without site template:

public function fooAction()
{
return $this->renderView('/local/modules/my.module/views/testfile.php', withSiteTemplate: false);
}
См. также
\Bitrix\Main\Engine\Response\Render\View
Аргументы
string$viewPath
array$params
bool$withSiteTemplate
Возвращает
View

См. определение в файле controller.php строка 1191

◆ run()

run ( $actionName,
array $sourceParametersList )
final
Аргументы
$actionName
array$sourceParametersList
Возвращает
HttpResponse|mixed
Исключения
SystemException

См. определение в файле controller.php строка 407

◆ runProcessingBinderThrowable()

runProcessingBinderThrowable ( BinderArgumentException $e)
protected

См. определение в файле controller.php строка 977

◆ runProcessingError()

runProcessingError ( \Error $error)
protected

См. определение в файле controller.php строка 971

◆ runProcessingException()

runProcessingException ( \Exception $e)
protected

Runs processing exception.

Аргументы
\Exception$eException.
Возвращает
void

См. определение в файле controller.php строка 965

◆ runProcessingIfInvalidCsrfToken()

runProcessingIfInvalidCsrfToken ( )
protected

Runs processing if csrf token is invalid.

Возвращает
void

См. определение в файле controller.php строка 1045

◆ runProcessingIfUserNotAuthorized()

runProcessingIfUserNotAuthorized ( )
protected

Runs processing if user is not authorized.

Возвращает
void

См. определение в файле controller.php строка 1034

◆ runProcessingThrowable()

runProcessingThrowable ( \Throwable $throwable)
protected

См. определение в файле controller.php строка 940

◆ runProcessingValidationException()

runProcessingValidationException ( ValidationException $e)
protected

См. определение в файле controller.php строка 999

◆ setActionConfig()

setActionConfig ( $actionName,
array $config = null )
finalprotected

См. определение в файле controller.php строка 933

◆ setCurrentUser()

setCurrentUser ( CurrentUser $currentUser)
final
Аргументы
CurrentUser$currentUser

См. определение в файле controller.php строка 276

◆ setScope()

setScope ( $scope)
final
Аргументы
string$scope
Возвращает
Controller

См. определение в файле controller.php строка 373

◆ setSourceParametersList()

setSourceParametersList ( $sourceParametersList)
final
Аргументы
array$sourceParametersList
Возвращает
Controller

См. определение в файле controller.php строка 393

◆ triggerOnAfterAction()

triggerOnAfterAction ( Action $action,
$result )
finalprotected

См. определение в файле controller.php строка 614

◆ triggerOnBeforeAction()

triggerOnBeforeAction ( Action $action)
finalprotected

Triggers the event {{static::EVENT_ON_BEFORE_ACTION}}

См. также
\Bitrix\Main\Engine\Controller::getFullEventName. This method is invoked right before an action is executed. In case the action should not run, event handler have to return EvenResult with type EventResult::ERROR.
Аргументы
Action$actionAction name.
Возвращает
bool

См. определение в файле controller.php строка 559

◆ writeToLogException()

writeToLogException ( \Throwable $e)
protected

См. определение в файле controller.php строка 470

Поля

◆ $configurator

Configurator $configurator
protected

См. определение в файле controller.php строка 54

◆ $errorCollection

$errorCollection
protected

См. определение в файле controller.php строка 50

◆ $request

$request
protected

См. определение в файле controller.php строка 52

◆ ERROR_REQUIRED_PARAMETER

const ERROR_REQUIRED_PARAMETER = 'MAIN_CONTROLLER_22001'

См. определение в файле controller.php строка 44

◆ ERROR_UNKNOWN_ACTION

const ERROR_UNKNOWN_ACTION = 'MAIN_CONTROLLER_22002'

См. определение в файле controller.php строка 45

◆ EVENT_ON_AFTER_ACTION

const EVENT_ON_AFTER_ACTION = 'onAfterAction'

См. определение в файле controller.php строка 42

◆ EVENT_ON_BEFORE_ACTION

const EVENT_ON_BEFORE_ACTION = 'onBeforeAction'

См. определение в файле controller.php строка 41

◆ EXCEPTION_UNKNOWN_ACTION

const EXCEPTION_UNKNOWN_ACTION = 22002

См. определение в файле controller.php строка 47

◆ SCOPE_AJAX

const SCOPE_AJAX = 'ajax'

См. определение в файле controller.php строка 38

◆ SCOPE_CLI

const SCOPE_CLI = 'cli'

См. определение в файле controller.php строка 39

◆ SCOPE_REST

const SCOPE_REST = 'rest'

См. определение в файле controller.php строка 37


Объявления и описания членов класса находятся в файле: