Skip to content

Instantly share code, notes, and snippets.

@robertbasic
Created October 8, 2012 20:47
Show Gist options
  • Select an option

  • Save robertbasic/3854871 to your computer and use it in GitHub Desktop.

Select an option

Save robertbasic/3854871 to your computer and use it in GitHub Desktop.
'router' => array(
'routes' => array(
// Literal route named "home"
'home' => array(
'type' => 'literal',
'options' => array(
'route' => '/',
'defaults' => array(
'controller' => 'Application\Controller\IndexController',
'action' => 'index'
)
)
),
// Literal route named "blog", with child routes
'blog' => array(
'type' => 'literal',
'options' => array(
'route' => '/blog',
'defaults' => array(
'controller' => 'Applicaton\Controller\BlogController',
'action' => 'index',
),
'may_terminate' => true,
'child_routes' => array(
// Segment route for viewing one blog post
'post' => array(
'type' => 'segment',
'options' => array(
'route' => '/:slug',
'constraints' => array(
'slug' => '[a-zA-Z0-9_-]+'
),
'defaults' => array(
'action' => 'view',
'slug' => ''
)
),
'may_terminate' => true
),
// Literal route for viewing blog RSS feed
'rss' => array(
'type' => 'literal',
'options' => array(
'route' => '/rss',
'defaults' => array(
'action' => 'rss'
)
)
)
)
)
)
),
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment