Skip to content

Instantly share code, notes, and snippets.

@japaveh
Created July 19, 2012 15:55
Show Gist options
  • Save japaveh/3144885 to your computer and use it in GitHub Desktop.
Save japaveh/3144885 to your computer and use it in GitHub Desktop.
Example of the new ZF2 router
'router' => array(
'routes' => array(
'equipment' => array(
'type' => 'Segment',
'options' => array(
'route' => '/equipment[/:action[/equipment-:id]].html',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9_-]*',
),
'defaults' => array(
'controller' => 'index',
'action' => 'index',
),
),
),
'module' => array(
'type' => 'Segment',
'options' => array(
'route' => '/equipment/module[/:action]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
),
'defaults' => array(
'controller' => 'index',
'action' => 'index',
),
),
),
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment