Skip to content

Instantly share code, notes, and snippets.

@Ocramius
Created January 26, 2012 00:38
Show Gist options
  • Save Ocramius/1680043 to your computer and use it in GitHub Desktop.
Save Ocramius/1680043 to your computer and use it in GitHub Desktop.
move-routes-setup-to-di zf2
<?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