Skip to content

Instantly share code, notes, and snippets.

@bkozora
Created January 5, 2015 15:37
Show Gist options
  • Select an option

  • Save bkozora/1a7d77d233525d885e58 to your computer and use it in GitHub Desktop.

Select an option

Save bkozora/1a7d77d233525d885e58 to your computer and use it in GitHub Desktop.
ZF2 Router
return array(
'controllers' => array(
'invokables' => array(
'Album\Controller\Album' => 'Album\Controller\AlbumController',
),
),
// The following section is new and should be added to your file
'router' => array(
'routes' => array(
'album' => array(
'type' => 'segment',
'options' => array(
'route' => '/album[/][:action][/:id]',
'constraints' => array(
'action' => '[a-zA-Z][a-zA-Z0-9_-]*',
'id' => '[0-9]+',
),
'defaults' => array(
'controller' => 'Album\Controller\Album',
'action' => 'index',
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'album' => __DIR__ . '/../view',
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment