Where routes live
Define routes in app/route.php as a PHP array:
php
<?php
return array(
'/doc/{id}' => '/home/index/docs',
);Rule format
Each entry is 'pattern' => 'target':
'custom pattern' => '/module/controller/action'
- Left — public URL pattern (for example
/docs/16). - Right — internal path
/module/controller/action.
Path parameters
Use {name} for variables; the framework maps them to GET parameters:
php
<?php
return array(
'/doc/{id}' => '/home/index/docs',
);Dispatch result
Requesting http://docs.local/docs/16 runs the home module, index controller, docs action, with id = 16.