1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
gridresponse.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Main\Grid\UI;
4
5
use Bitrix\Main\Application;
6
use Bitrix\Main\Engine\Response\Json;
7
use CMain;
8
12
class
GridResponse
implements
\Bitrix\Main\Grid\GridResponse
13
{
17
private
array
$messages = [];
18
private
mixed $payload =
null
;
19
30
public
function
addMessage
(
string
$message
,
string
$type
): void
31
{
32
$this->messages[] = [
33
'TYPE'
=>
$type
,
34
'TEXT'
=>
$message
,
35
];
36
}
37
45
public
function
setPayload
(mixed $payload): void
46
{
47
$this->payload = $payload;
48
}
49
55
public
function
isSendable
(): bool
56
{
57
return
!(
58
empty($this->messages) && empty($this->payload)
59
);
60
}
61
67
public
function
send
(): void
68
{
69
global
$APPLICATION
;
70
74
75
$APPLICATION
->RestartBuffer();
76
77
// TODO: fix JS code for correct work without messages
78
$responseData = [
79
'messages'
=>
$this->messages
,
80
];
81
if
(!empty($this->payload))
82
{
83
$responseData[
'payload'
] = $this->payload;
84
}
85
86
$response
=
new
Json
($responseData);
87
88
Application::getInstance
()->end(200,
$response
);
89
}
90
}
$type
$type
Определения
options.php:106
$APPLICATION
global $APPLICATION
Определения
include.php:80
Bitrix\Main\Application\getInstance
static getInstance()
Определения
application.php:98
Bitrix\Main\Grid\UI\GridResponse
Определения
gridresponse.php:13
Bitrix\Main\Grid\UI\GridResponse\setPayload
setPayload(mixed $payload)
Определения
gridresponse.php:45
Bitrix\Main\Grid\UI\GridResponse\addMessage
addMessage(string $message, string $type)
Определения
gridresponse.php:30
Bitrix\Main\Grid\UI\GridResponse\isSendable
isSendable()
Определения
gridresponse.php:55
Bitrix\Main\Web\Json
Определения
json.php:9
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
Bitrix\Main\Grid\GridResponse
Определения
gridresponse.php:13
Bitrix\Main\Grid\GridResponse\send
send()
Определения
gridresponse.php:67
$message
$message
Определения
payment.php:8
$messages
$messages
Определения
template.php:8
$response
$response
Определения
result.php:21
bitrix
modules
main
lib
grid
ui
gridresponse.php
Создано системой
1.14.0