2.0.0
2.0.0.0
The Requires
The Development Requires
dev-master
9999999-dev
The Requires
The Development Requires
1.0.0
1.0.0.0
The Requires
The Development Requires
Wallogit.com
2017 © Pedro Peláez
Small utility that routes to methods named after HTTP verbs to help make API development easier., (*1)
Using composer!, (*2)
composer install mrferos/expressive-method
Example action:, (*3)
<?php
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!
}
}
That's it!, (*4)
There is also an interface MrfExpressive\HttpMethodInterface that defines methods for all the HTTP verbs., (*5)