← DocumentationRouting · yaml

Routing with YAML

Declare response type and controller action in routing.yml.

01

Declarative routes

A routing key resolves from the request path and provides the scope used by the project application.

02

Clear contracts

Keeping action and media type together makes API endpoints reviewable without opening controller code.

03

Visual result

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

yaml
Visual result deterministic

Routing with YAML

GET
/customers/42
Action
CustomerCtrl::show
Content-Type
application/json