开发者

Where does backend belong to in Zend Framework

Do you have it as a separate Module, or just one separate Controller, or multiple Controllers without 开发者_如何转开发any logical separation from Frontend (except for Auth ofcourse), or something else?

Assuming that backend is reasonably complicated, i.e. something more than review/confirm/delete comments for your BLOG.


Definatly belongs in a new module then it is easy to create a separate layout in my opinion.

In a recent project a colleague created a separate admin controller in each module with the layout defined in an admin module. This way he could drop in/remove modules from the project with the main admin module autodetecting which modules are installed and creating menus based on the admin controller found in each pluggable module.

I have explained that poorly, but it's a good system.


I would create a separate module. Otherwise you might run into context issues because the ArticleController in the frontend should have other/limited functionalities then the administrative ArticleController and you end up implementing mixed controller classes (bad idea!) or prefix the administrative class.

So having multiple modules makes it easier to separate different concerns.

(Plus it will make it easier for you to implement an ACL and handle the corresponding resource/role definitions.)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜