Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
gridresponse.php
1<?php
2
3namespace Bitrix\Main\Grid\UI;
4
7use CMain;
8
13{
17 private array $messages = [];
18
29 public function addMessage(string $message, string $type): void
30 {
31 $this->messages[] = [
32 'TYPE' => $type,
33 'TEXT' => $message,
34 ];
35 }
36
42 public function isSendable(): bool
43 {
44 return ! empty($this->messages);
45 }
46
52 public function send(): void
53 {
54 global $APPLICATION;
55
60 $APPLICATION->RestartBuffer();
61
62 $response = new Json([
63 'messages' => $this->messages,
64 ]);
65
66 Application::getInstance()->end(200, $response);
67 }
68}
addMessage(string $message, string $type)