Layout ZF2中的Zend布局
如果布局文件夹位于模块目录的外侧,我们如何在zf2中设置默认布局Layout ZF2中的Zend布局,layout,zend-framework2,Layout,Zend Framework2,如果布局文件夹位于模块目录的外侧,我们如何在zf2中设置默认布局 您可以在任何地方设置布局,而不必在模块目录中 只需在模块配置中设置它 'view_manager' => array( 'display_not_found_reason' => true, 'display_exceptions' => true, 'doctype' => 'HTML5', 'not_found_templat
您可以在任何地方设置布局,而不必在模块目录中 只需在模块配置中设置它
'view_manager' => array(
'display_not_found_reason' => true,
'display_exceptions' => true,
'doctype' => 'HTML5',
'not_found_template' => 'error/404',
'exception_template' => 'error/index',
'template_map' => array(
'layout/layout' => '/anypath/you/want/view/layout/layout.phtml',
),
'template_path_stack' => array(
'/anypath/you/want/view',
),
),
根据发布的问题,@Andrew的答案是正确的 当我注意到zf2中的布局工作时,我得出了一定的结论
'modules' => array(
'Album',
'Testlist',
'Customer',
'Application',
'User',
),
然后将采用用户布局
如果我们在应用程序中只有一个布局,这将很好
在模块中切换布局时遇到
这似乎很有用默认布局是在视图管理器中配置的
layout/layout
。从zf2开始,我有两个模块album和user,我应该选择哪个模块.config.php(在album或user中)来设置默认布局?我可以将此代码视为“template\u map”=>array('layout/layout'=>DIR./../view/layout/layout.phtml),您能检查一下这篇文章吗