PHP Класс Api\Model\Payload

Class represents json output that is sent to clients via REST API interface. Output is standardized and consists of error message (if applicable) and custom formatted content. Example for index page: { "error": false, "content": "welcome to api." } If there was an error, the reason should be described within error property. HTTP status code is always 200, since server itself responded with no error.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
__construct ( $content, $error = false )
toArray ( )

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

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

public __construct ( $content, $error = false )

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

public toArray ( )