PHP code example of mrferos / expressive-http-method
1. Go to this page and download the library: Download mrferos/expressive-http-method 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/ */
mrferos / expressive-http-method example snippets
namespace App\Action;
use MrfExpressive\HttpMethodTrait;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
class AcmeAction
{
use HttpMethodTrait;
/**
* For GET method
*
* @param ServerRequestInterface $request
* @param ResponseInterface $response
* @param callable|null $next
* @return mixed
*/
public function get(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
// Do anything here you normally would!
}
}