Skip to content

Instantly share code, notes, and snippets.

@rufinus
Created December 10, 2012 15:47
Show Gist options
  • Select an option

  • Save rufinus/4251359 to your computer and use it in GitHub Desktop.

Select an option

Save rufinus/4251359 to your computer and use it in GitHub Desktop.
Generic Route
'router' => array(
'routes' => array(
'home' => array(
'type' => 'Literal',
'options' => array(
'route' => '/',
'defaults' => array(
'__NAMESPACE__' => 'Admin\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
),
'admin' => array(
'type' => 'Segment',
'options' => array(
'route' => '[/:controller[/[:action[/[:id]]]]]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'__NAMESPACE__' => 'Admin\Controller',
'controller' => 'Index',
'action' => 'index',
),
),
'may_terminate' => true,
'child_routes' => array(
'default' => array(
'type' => 'Wildcard',
'options' => array(
)
)
)
),
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment