PHP code example of enjoy / http-status-code

1. Go to this page and download the library: Download enjoy/http-status-code 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/ */

    

enjoy / http-status-code example snippets



use Entoy/HttpStatusCode/StatusCodes;

class ExampleController extends BaseController
{
    public function indexAction()
    {
        $this->renderError("Bad request", StatusCodes::HTTP_BAD_REQUEST);
    }
}
bash
php composer.phar install enjoy/http-status-code