PHP Class 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.
Mostra file Open project: oleksandr-torosh/yona-cms Class Usage Examples

Public Methods

Method Description
__construct ( $content, $error = false )
toArray ( )

Method Details

__construct() public method

public __construct ( $content, $error = false )

toArray() public method

public toArray ( )