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.
Afficher le fichier Open project: oleksandr-torosh/yona-cms Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( $content, $error = false )
toArray ( )

Method Details

__construct() public méthode

public __construct ( $content, $error = false )

toArray() public méthode

public toArray ( )