views:

20

answers:

1

I'm trying out the module-based architecture for my application, where the default module is what used to be the main application before.

modules/
     default/
     firstmodule
     secondmodule
     thirdmodule

Each module has its models, views, controllers. This is the default module as an example.

     default/
        models
        views
        controllers
           IndexController

My problem is with the ErrorController that zend creates by default at application/controllers/ErrorController.php. I'd like to move it into the default module's controllers folder, but I wonder if it needs any special treatment, being the ErrorController and all?

Should I move it to modules/default/controllers/ErrorController.php,

or should I leave it at application/controllers/ErrorController.php

Edit: If I move it to default/controllers, then each of the other modules would not have an ErrorController. Does that mean that I'd have to define one for each module since the application itself doesn't have an ErrorController? and is it worth it to define one for each module?

+1  A: 

How come you still have things in the old structure, rather than all the leftovers moved the default module.

My directory structure is like so:

/application/data/
/application/config/
/application/modules/balcms/controllers/
/application/modules/burn/controllers/
/application/modules/default/controllers/
/library/
/public/
...

Only special treatment is ensure your prefix is correct for your autoloader (this can be optional).

balupton