-- photo312 <[EMAIL PROTECTED]> wrote
(on Tuesday, 08 April 2008, 10:21 PM -0700):
> I would like to "turn on" controllers dynamically depending on the user
> logged in...so if the user type logged-in is "client" than it would load:
> 
> $controller->setControllerDirectory(array(
>       'default'       => '../application/client/controllers'      
> ));

I'd instead call this in your bootstrap:
    
    $controller->setModuleDirectory('path/to/application/');

and then write a routeShutdown() plugin that performs the logic
necessary to determine the 'client', and sets that as the current
module in the request:

    $request->setModuleName($client);

This will allow you to do:

> this way I can have my modules in different directories and only use the
> controllers that are residing in the directory that suits the user type.

in a more reliable fashion.


> photo312 wrote:
> > 
> > I have 4 different user groups and each user group will get different
> > functionality and looks. So I have decided to divide it up into modules
> > with separate front controllers each. 
> > 
> > Can you please tell me if this modular directory structure would work well
> > in Zend Framework:
> > 
> > ----library/
> > -----------Zend/
> > ----config/
> > ----public/
> > -----------index.php
> > ----application/
> > -----------default/
> > -----------------controllers/
> > -----------------models/
> > -----------------views/
> > -----------------------scripts/
> > -----------------------helpers/
> > -----------------------filters/
> > ------------client/
> > ------------------controllers/
> > ------------------models/
> > ------------------views
> > -------------------...just like above
> > 
> > 
> 
> -- 
> View this message in context: 
> http://www.nabble.com/Creating-a-Modular-Dir-Structure-tp16578887p16579738.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
> 

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/

Reply via email to