markizano wrote:
> 
> ZF already picks up on the module autoloader, you just need to make sure
> you 
> have a module-specific Bootstrap in place:
> http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html
> 
>>          $autoloader = new Zend_Application_Module_Autoloader(array(
>>              'namespace' =>  'Content1_',
>>              'basePath'  =>  APPLICATION_PATH . '/modules/content1'
>>          )); 
> 

That means instead of adding the autoloader in my Bootstrap.php (extends
Zend_Application_Bootstrap_Bootstrap) I simply add a Bootstrap.php (extends
Zend_Application_Module_Bootstrap) in each module, right?


markizano wrote:
> 
> 
> 


markizano wrote:
> 
> I would remove that plugin all-together and push this to your bootstrap,
> like so:
> 
> https://github.com/markizano/markizano/blob/master/application/Bootstrap.php#L214
> 
> Except, instead of adding the route directly, of course you would have
> this 
> under the IF() condition expressed in your plugin.
> 

The reason i moved to a plugin was that the plugin also sets special values
(sessions etc.) depending on the APPLICATION_ID. This helps me to keep it
all-in-one.

Based on your example I tried the Router_Regex code in my Bootstrap.php just
in order to get the route working first.
The difference in my application is that the controller is not only calles
ContentController, it can be any controller-name. I tried something like
this but it did not work out:


    protected function _initRoutes()
    {
        $frontController = Zend_Controller_Front::getInstance();
        $router = $frontController->getRouter();

        $router->addRoute(
            'content',
            new
Zend_Controller_Router_Route(':module/:controller/:action/*',
                array(
                    'module' => 'khws-leer'
                )
            )
        );
    }


This also seems to be the reason for the error message I posted:
'Invalid controller specified (content).

Can you correct my code this purpose?

I thought about then moving the correct code into each module bootstrap
class.
But since ZF handles every bootstrap in a row the first module bootstrap
would overwrite the follwing ones, right? Again a good point to chose the
plugin?

--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Dynamically-routing-a-module-to-different-controllers-tp3582673p3585113.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to