-- naioshi cozmicboy <[EMAIL PROTECTED]> wrote
(on Tuesday, 12 June 2007, 09:57 PM +0200):
> thank you for you explanation. Now it makes sense to me
> and I'll probably end up using just one module ('default')
> containing all the controllers (which I was wrongly
> referring to as modules; i have to get used to the
> terminology).
> 
> The only think I will miss is not having the modular
> directory structure:
> 
> app
> - default
> - accounts
> - library
> - forum
> - service
> 
> instead I will have everything in one directory
> 
> app
> - default (containing everything)
> 
> But again, I think I can get used to that.

If any of your controllers start to seem unmanageable, or if you start
to notice that you could group related actions into separate
controllers, then you may still end up with your modular directory
structure. :-)

I definitely see the benefit of modules -- I was one of those pushing to
get them into the ZF MVC -- but I also think it's easy to abuse the
model. Unless you are planning on distributing the application as a
standalone module or creating a complex app with many screen types, in
most cases a single controller in the default module will suffice.

Something else to consider: you can always create these as modules with
a single index controller. Then create custom routing rules like the
following:

    $forumRoute = new Zend_Controller_Router_Route(
        'forum/:action/*',
        array(
            'module' => 'forum',
            'controller' => 'index',
            'action' => 'index'      // default action
        )
    );
    $router->addRoute('forum', $forumRoute);

However, this is more overhead in your bootstrap.

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

Reply via email to