开发者

ErrorController: worth it to move it to a default module

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 modul开发者_开发技巧es/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?


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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜