Web Routing
The documentation is constantly evolving and updated alongside the project's progress. Since it is developed in parallel with the code, some sections may temporarily refer to earlier versions of the system-these are gradually adapted to the current state of the application. If you notice any outdated information, please report it or open an Issue / Pull Request.
Documentation
# Web Routing
DBM Framework routes are registered explicitly through Dbm\Routing\RouteBuilder. In DBM Platform, web routes are loaded from bootstrap/web.php by bootstrap/app.php; the small framework example uses example/bootstrap/routes.php.
# Register routes
$routes->get('/', [HomeController::class, 'index'], 'home');
$routes->get('/articles/{slug}', [ArticleController::class, 'show'], 'article.show');
$routes->post('/articles', [ArticleController::class, 'create'], 'article.create');
Route handlers use a controller class and method. Route names are optional identifiers used by the URL generator. Supported verbs include GET, POST, PUT, PATCH, DELETE, and any() for a route accepting any method.
# Parameters and groups
A placeholder such as {slug} is matched from the path and made available to the controller action. The action argument resolver can map named parameters and cast supported scalar types.
$routes->group('/admin', function (RouteBuilder $routes): void {
$routes->get('/reports', [ReportController::class, 'index'], 'admin.reports');
}, [RequireAdminMiddleware::class]);
Groups add a path prefix and can attach middleware to their routes. Use route names consistently and generate links through the URL generator or the configured template helper instead of hard-coding paths.
# Registration is explicit
PHPDoc comments such as @routing GET '/articles' are descriptive only. They do not register routes by themselves. Attribute routing classes exist in the framework source, but applications should use the route loader they actually wire into their bootstrap; DBM Platform currently composes routes with RouteBuilder.
For the platform's web/API split and entry points, see Routing and API Routing.