Skip to content

Instantly share code, notes, and snippets.

@outman
Created November 25, 2012 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save outman/4143133 to your computer and use it in GitHub Desktop.
Save outman/4143133 to your computer and use it in GitHub Desktop.
ZendFramework2 route for new module by segment
return array(
'controllers' => array(
'invokables' => array(
'Admin\Controller\Index' => 'Admin\Controller\IndexController',
'Admin\Controller\Dash' => 'Admin\Controller\DashController',
),
),
'router' => array(
'routes' => array(
'admin' => array(
'type' => 'segment',
'options' => array(
'route' => '/admin[/:controller][/:action][/]',
'constraints' => array(
'controller' => '[a-zA-Z][a-zA-Z0-9_-]+',
'action' => '[a-zA-Z][a-zA-Z0-9_-]+',
),
'defaults' => array(
'__NAMESPACE__' => 'Admin\Controller',
'controller' => 'Index',
'action' => 'index'
),
),
),
),
),
'view_manager' => array(
'template_path_stack' => array(
'admin' => __DIR__ . '/../view/',
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment