2013-08-21 104 views
0

我有两个模块相册和注册。我需要在注册模块中设置布局。我的困难在这里,我需要在注册模块中为页面设置一个layout.phtml,但layout.phtml位于相册模块中。Zf2 - 从其他模块访问布局

回答

0

尝试使用EdpModuleLayouts https://github.com/EvanDotPro/EdpModuleLayouts

“使用EdpModuleLayouts是非常非常简单的在任何模块的配置和自动加载的配置文件,只需指定以下内容:”

array(
    'module_layouts' => array(
    'Album' => 'layout/album', 
    'Signup' => 'layout/signup', 
), 
); 
+0

我得到了答案,在我的控制器/ action使用$ this-> layout(“anothermodule/layoutname”);并且正确地工作。Thankyou .. – Anna