zend framework - Zend_Layout for modules -


How do I make each module my layout directory?

Ie When I do not have any module, my layout entry in the config file looks like this:

  resources.layout.layoutPath = APPLICATION_PATH "/ layout" < / Code>  

I try to enter either

 ; Admin Module admin.resources.layout.layoutPath = for layout directory = APPLICATION_PATH "/ module / admin / layout"   

where the admin module is named; But it does not work in ZF module layout / module / admin / view / script directory for some strange reasons.

I also have a separate module .in config file for each module, so the layout is ignored in the form of the path. Apart from this, I am trying to follow this module but it is not working, I think the difference in ZF versions (Tutorial is rather old). So I do not know what to do

Using the plugin from the tutorial you are talking about it Are:

  class My_Controller_Plugin_RequestedModuleLayoutLoaderZend_Controller_Plugin_Abrstract {Public Function Pre Dispatch (Zend_Controller_Request_Abstract $ request) {$ config = Zend_Controller_Front :: getInstance () - & gt; GetParam ('Bootstrap') - & gt; GetOptions (); $ Modulation name = $ request- & gt; GetModuleName (); If (isset ($ config [$ moduleName] ['resource'] ['layout'])) {Zend_Layout :: startMvc ($ config [$ moduleName] ['resource'] ['layout']); }}}   

application.ini

  resources.frontController.plugins.layoutloader = My_Controller_Plugin_RequestedModuleLayoutLoader   

module.ini :

  resources.layout.layout = "Admin" resources.layout.layoutPath = APPLICATION_PATH "/ module / admin / layout / script"   

work fine is .

Comments