Created
January 26, 2012 00:38
-
-
Save Ocramius/1680043 to your computer and use it in GitHub Desktop.
move-routes-setup-to-di zf2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
return array( | |
'layout' => 'layout/layout.phtml', | |
'display_exceptions' => true, | |
'di' => array( | |
'instance' => array( | |
'alias' => array( | |
'index' => 'Application\Controller\IndexController', | |
'error' => 'Application\Controller\ErrorController', | |
'view' => 'Zend\View\PhpRenderer', | |
'route_default' => 'Zend\Mvc\Router\Http\Segment', | |
'route_home' => 'Zend\Mvc\Router\Http\Literal', | |
), | |
'Zend\Mvc\Controller\ActionController' => array( | |
'parameters' => array( | |
'broker' => 'Zend\Mvc\Controller\PluginBroker', | |
), | |
), | |
'Zend\View\PhpRenderer' => array( | |
'parameters' => array( | |
'resolver' => 'Zend\View\TemplatePathStack', | |
'options' => array( | |
'script_paths' => array( | |
'application' => __DIR__ . '/../view', | |
), | |
), | |
), | |
), | |
'route_default' => array( | |
'parameters' => array( | |
'route' => '/[:controller[/: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', | |
), | |
), | |
), | |
'route_home' => array( | |
'parameters' => array( | |
'route' => '/', | |
'defaults' => array( | |
'controller' => 'index', | |
'action' => 'index', | |
), | |
), | |
), | |
'Zend\Mvc\Router\Http\ServiceLocatorRouteStack' => array( | |
'parameters' => array( | |
'routes' => array( | |
//this is a repetition, maybe not very user friendly | |
'default' => 'route_default', | |
'home' => 'route_home', | |
), | |
), | |
), | |
), | |
), | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment