1. Go to this page and download the library: Download k9u/request-mapper 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/ */
k9u / request-mapper example snippets
use K9u\RequestMapper\Annotation\GetMapping;
use My\App\Presentation\Blog;
class BlogController
{
/**
* @GetMapping("/blogs/{id}")
*/
public function show($id)
{
// snip(find blog by $id)
$blog = [
'id' => $id,
'title' => 'Hello world!',
...
];
return $blog;
}
}