1. Go to this page and download the library: Download milpa/http 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/ */
milpa / http example snippets
use Milpa\Http\HttpMethod;
use Milpa\Http\Routing\Route;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
final class ShowUser
{
#[Route('/users/{id}', HttpMethod::GET, name: 'users.show')]
public function __invoke(ServerRequestInterface $request): ResponseInterface
{
// ...
}
}