$router = new \Phroute\Phroute\RouteCollector(); $router->get('/', function() { return 'Hello World!'; }); // Accessing via URL: http://localhost/
$router->get('/blog/{id}', function($id) { return 'Blog post '.$id; }); // Accessing via URL: http://localhost/blog/123
$router->get('/users/{id}', ['App\Controllers\UserController', 'show']); // Accessing via URL: http://localhost/users/123This code creates a route that matches URLs with a numeric "id" parameter and executes the "show" method of the "UserController" class when accessed. The package library used in the above examples is Phroute.