How to create admin in Zend framework?

三世轮回 提交于 2019-12-06 13:44:35

问题


I am a Zend developer and I have developed one application without an admin panel. Now I want to develop an admin panel for that, so how can I develop it from the start?

  1. What do I have to write for the redirect to the admin panel like "http://localhost/zend/public"?

  2. How do I add an admin controller or module?

  3. Layout of admin.

  4. Where do I put an admin folder or what do I change in Bootstrap?


回答1:


Well there are many ways. It depends on what sort of admin interface you actually need.

But usually:

1) You should have a separate module for the admin interface. That implies module based MVC structure.

2) You will want to use Zend_Acl to define user access list. I.e. create roles (for instance: guest, user, moderator, admin) and define what modules/controllers/actions they should have or should not have access to.

3) Use Zend_Auth to authenticate users.

4) Probably propagate the user information through session using Zend_Session and Zend_Session_Namespace.

5) Do at least basic security measures (prepared statements against SQL injections and $this->view->escape against XSS, possibly use CSRF token for all forms). If it is a commercial application, get a certificate.



来源:https://stackoverflow.com/questions/4677692/how-to-create-admin-in-zend-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!