@marriosdev
composer require marrios/mareaturborouter
<?php
require_once("vendor/autoload.php");
use MareaTurbo\Router;
use MareaTurbo\Route;
class ControllerTeste
{
public function __construct()
{}
#[Route("/teste/{id}", "GET")]
public function teste($parameters)
{
echo $parameters->id;
}
}
// Register controllers
(new Router())->controllers([
ControllerTeste::class
]);
In your browser, access the URL: http://localhost/teste/123
And you will see the result: 123
You can run this route in CLI mode
php .\index.php GET /teste/123