1. Go to this page and download the library: Download dlunire/dlroute 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/ */
use DLRoute\Requests\DLRoute as Route;
use DLRoute\Test\TestController;
Route::get('/ruta', [TestController::class, 'method']);
Route::get('/ruta/{parametro}', [TestController::class, 'method']);
final class TestController extends Controller {
public function tu_metodo(object $params): object|string {
return $params; // o HTML si deseas
}
}