1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
contentjson.php
См. документацию.
1
<?php
8
namespace
Bitrix\Sender\Internals\QueryController;
9
10
use Bitrix\Main\Localization\Loc;
11
use Bitrix\Main\Web\Json;
12
13
Loc::loadMessages(__FILE__);
14
19
class
ContentJson
extends
Content
20
{
21
protected
$parameters
=
array
();
22
23
public
function
set
(
array
$parameters
)
24
{
25
$this->parameters =
$parameters
;
26
}
27
28
public
function
add
(
$name
, $value)
29
{
30
$this->parameters[
$name
] = $value;
31
}
32
33
public
function
toText
()
34
{
35
$default =
array
(
36
'error'
=> !$this->errors->isEmpty(),
37
'text'
=> implode(
'<br>'
, $this->getErrorMessages()),
38
);
39
$errorCodes = [];
40
foreach
($this->
getErrorCollection
() as
$error
)
41
{
43
if
(
$error
->getCode())
44
$errorCodes[] =
$error
->getCode();
45
}
46
if
($errorCodes)
47
{
48
$default[
'code'
] = $errorCodes[0];
49
}
50
return
Json::encode($this->parameters + $default);
51
}
52
53
public
function
onFlush
()
54
{
55
$this->response->addHeader(
'Content-Type'
,
'application/json; charset=UTF-8'
);
56
}
57
}
Bitrix\Sender\Internals\QueryController\Content
Определения
content.php:21
Bitrix\Sender\Internals\QueryController\Content\toText
toText()
Bitrix\Sender\Internals\QueryController\Content\getErrorCollection
getErrorCollection()
Определения
content.php:91
Bitrix\Sender\Internals\QueryController\ContentJson
Определения
contentjson.php:20
Bitrix\Sender\Internals\QueryController\ContentJson\add
add($name, $value)
Определения
contentjson.php:28
Bitrix\Sender\Internals\QueryController\ContentJson\onFlush
onFlush()
Определения
contentjson.php:53
Bitrix\Sender\Internals\QueryController\ContentJson\$parameters
$parameters
Определения
contentjson.php:21
array
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения
file_new.php:804
$name
$name
Определения
menu_edit.php:35
$error
$error
Определения
subscription_card_product.php:20
bitrix
modules
sender
lib
internals
querycontroller
contentjson.php
Создано системой
1.14.0