This isn't going to work that way. You can configure your view manager's
template_map to alias different templates names in each of modules you are
using then for sure you won't have them overriden.

Something like:
in FrontendModule:
'config' => array(
  'view_manager' => array(
    'template_map' => array(
      'frontendLayout' => __DIR__ . '/../view/layout/layout.phtml'
    )
  )
)

in BackendModule:
'config' => array(
  'view_manager' => array(
    'template_map' => array(
      'backendLayout' => __DIR__ . '/../view/layout/layout.phtml'
    )
  )
)

But as I mentioned in my prev. post personally I would not consider frontend
and backend as modules that do everything. At the end of the day it's all up
to you and definitely with ZF2 you can still achieve what you want really.


ghola wrote
> 
> 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.
> 




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

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to