PHP Класс Webiny\Component\Http\Response\JsonResponse

Наследование: extends Webiny\Component\Http\Response, use trait Webiny\Component\StdLib\StdLibTrait
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( string | array | ArrayObject $content, array $headers = [], boolean $prettyPrint = false ) Base constructor.
sendJson ( string | array | ArrayObject $content, array $headers = [] ) Creates a JsonResponse instance and sends the output to the browser.

Описание методов

__construct() публичный Метод

Base constructor.
public __construct ( string | array | ArrayObject $content, array $headers = [], boolean $prettyPrint = false )
$content string | array | Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObject Json content.
$headers array Headers to attach to the response.
$prettyPrint boolean Should we use JSON_PRETTY_PRINT to nicely format the output.

sendJson() публичный статический Метод

This is just a short hand method for creating a new JsonResponse instance and then calling the "send" method.
public static sendJson ( string | array | ArrayObject $content, array $headers = [] )
$content string | array | Webiny\Component\StdLib\StdObject\ArrayObject\ArrayObject Json content.
$headers array Headers to attach to the response.