PHP code example of seeren / router
1. Go to this page and download the library: Download seeren/router 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/ */
seeren / router example snippets
namespace App\Controller;
use Seeren\Controller\JsonController;
use Seeren\Router\Route\Route;
class FooController extends JsonController
{
#[Route("/path/(\d+)", "GET")]
public function show(int $id)
{
return $this->render([]);
}
}
use Seeren\Router\Router;
$router = new Router();
$response = $router->getResponse();