← DocumentationRouting · php

Routing with PHP

Register dynamic routes close to application code when a callable is the clearer choice.

01

Programmatic routes

PHP routing fits routes that depend on an application composition step.

02

Controlled execution

Only application-owned callables are registered; public examples never evaluate user-supplied PHP.

03

Visual result

Examples are deterministic previews. PHP and shell code is never executed in the browser or on the public server.

php
$app->route('/customers/{id}', function () use ($services) {
    return CustomerCtrl::show($services);
});
Visual result deterministic

Routing with PHP

Route
/customers/{id}
Resolver
PHP callable
Execution
Application-owned