Skip to content

Instantly share code, notes, and snippets.

@anderprc
Last active December 18, 2015 21:59
Show Gist options
  • Save anderprc/5851260 to your computer and use it in GitHub Desktop.
Save anderprc/5851260 to your computer and use it in GitHub Desktop.
/**/
$return = new \stdClass();
// Add some test data
$return->status = true;
$return->success = new \stdClass();
$return->success->id = 1988;
$return->success->msg = "Message";
$return->success->data = new \stdClass();
$return->error = new \stdClass();
$return->error->code = 1988;
$return->error->msg = "An error occurred!";
$return->error->msgHid = "An error occurred in action xxx!";
$return->error->redirect = "/route";
/**
stdClass Object
(
[status] => true|false
[success] => stdClass Object
(
[id[Table/opc]] => 19880803
[id[Table2/opc]] => 19880430
[msg] => "Message"
[data] => string|stdClass Object
(
[var1] => "for example"
)
)
[false] => stdClass Object
(
[code] => -1|0|1|2
[msg] => "An error occurred!"
[msgHid] => "An error occurred in action xxx!"
[redirect] => "/route"
)
)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment