PHP code example of delatbabel / jsonresponses

1. Go to this page and download the library: Download delatbabel/jsonresponses library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

delatbabel / jsonresponses example snippets


use Delatbabel\JsonResponses\JsonResponses;

class MyController
{
    use JsonResponses;
    // ...
}

return $this->respondSuccess('OK', ['time' => gmtime()]);

return $this->respondInternalError();

return $this->respondNotAcceptable(
    'Mugwumps are not found in swamps',
    ['location' => 'desert']);