A more elegant alternative which would in fact enable true per route based
configuration would be to be able to specify a per route config. Like this
(as part of a module.config.php file):

'router' => array(
        'routes' => array(
                'backend' => array(
                        'type' => 'segment',
                        'options' => array(
                                'route' => '/backend[/:controller[/:action]]',
                                'constraints' => array(
                                        'controller' => 
'[a-zA-Z][a-zA-Z0-9_-]*',
                                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*'
                                ),
                                'defaults' => array(
                                        'controller' => 
'Backend\Controller\Index',
                                        'action' => 'index'
                                ),
                                'config' => array(
                                        'view_manager' => array(
                                                'template_map' => array(
                                                        'layout/layout' => 
__DIR__ . '/../view/layout/layout.phtml'
                                                )
                                        )
                                )
                        )
                )
        )
)

Notice the 'config' key. 



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/ZF2-per-route-or-module-configuration-tp4656844p4656845.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to