AjaxJson
\Bitrix\Main\Engine\Response\AjaxJson - JSON response methods.
By default, all responses from controllers \Bitrix\Main\Engine\Controller has standartized structure, handled by JS API [link=]BX.ajax.runAction[/link], [link=]BX.ajax.runComponentAction[/link]:
{ "status": string, "data": mixed, "errors": array }
Methods
Method | Description | Available from version |
---|---|---|
__construct( $data = null, $status = self::STATUS_SUCCESS, ErrorCollection $errorCollection = null ) | Class constructor. Parameters:
| |
createSuccess( $data = null ) | Create AjaxJson object with success status. | |
createError( ErrorCollection $errorCollection = null, $data = null ) | Create AjaxJson object with error status and allows passing collection of errors and data, if required. | |
createDenied( ErrorCollection $errorCollection = null, $data = null ) | Create AjaxJson object with denied status and allows passing collection of errors and data, if required. |
© «Bitrix24», 2001-2024