There's a couple of ways of handling this. Essentially either with or w/o the
layout resource plugin.

Unless you have a good reason not to use the resource plugin I would take
that route in which case, all you should need to do is add the plugin class
to the resource plugin config. E.g.

resources.layout.pluginClass = "My_Layout_Plugin"

See http://framework.zend.com/manual/en/zend.layout.options.html for other
layout options.


drpudding wrote:
> 
> I am new to Zend and Nabble, but have searched many places for a solution
> before posting.
> 
> I have implemented a simple module directory structure with 2 modules
> (admin & public) like so:
> 
> application
> --configs
> --models
> --modules
> ----bootstrap.php
> ----admin (module1)
> -------controllers
> -------layouts
> -------views
> ----public (module2)
> -------controllers
> -------layouts
> -------views
> 
> My config file uses this:
> resources.frontcontroller.moduledirectory = APPLICATION_PATH "/modules"
> resources.frontcontroller.defaultmodule = "public"
> resources.frontcontroller.throwexceptions = false
> resources.frontcontroller.params.prefixDefaultModule = false
> 
> The modules load correctly if I have a common layouts folder in
> 'application,' but I am having trouble getting custom layout folders in
> the modules.
> 
> I am trying to use a plugin registered as follows in config:
> autoloaderNamespaces[] = "Mac_"
> resources.frontController.plugins.Layouts = "Mac_Plugin_Layouts"
> 
> And the plug in looks like this:
> class Mac_Plugin_Layouts extends Zend_Controller_Plugin_Abstract
> {
>       public function dispatchLoopStartup(Zend_Controller_Request_Abstract
> $request)
>       {
>               $layoutPath = APPLICATION_PATH . '/modules/' . 
> $request->getModuleName()
> . '/layouts/';
>               Zend_Layout::getMvcInstance()->setLayoutPath($layoutPath);
>       }
> }
> 
> I am getting an error:
> Uncaught exception 'Zend_Application_Bootstrap_Exception' with message
> 'Resource matching "layout" not found' in...
> 
> When using a common layouts folder and no plug in with the layout path set
> in config, all is fine:
> resources.layout.layoutpath = APPLICATION_PATH "/layouts"
> 
> My suspicion is that the plug is not even be registering, since the error
> suggests that no layout path is being set, right?
> 
> Thanks for any assistance!
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Problem-registering-plugin-for-module-based-layouts-tp25386508p25397308.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to