1. Go to this page and download the library: Download icanboogie/bind-routing 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/ */
icanboogie / bind-routing example snippets
namespace App\Presentation\HTTP
use ICanBoogie\Accessor\AccessorTrait;use ICanBoogie\Binding\Routing\Attribute\Get;use ICanBoogie\Binding\Routing\Attribute\Route;use ICanBoogie\Routing\ControllerAbstract;
#[Route('/skills')]
final SkillController extends ControllerAbstract
{
use AccessorTrait;
// This will create a 'GET /skills' route with 'skills:list' action
#[Get]
private function list(): void
{
// …
}
// This will create a 'GET /skills/:slug' route with 'skills:show' action
#[Get('/:slug')]
private function show(string $slug): void
{
// …
}
// This will create a 'POST /skills' route with 'skills:create' action
#[Post]
private function create(): void
{
// …
}
}