Zend Framework:创造新领先
这几天我一直在学习Zend框架。我现在处于初级水平。
我收到了一个问题陈述:
/* Create a new lead
*
* planId will be sent $_GET['planId'], the form should send the action to
* the same page
* a user should be logged in and he should be administrator of the plan
*
* @uses Plans_Model_Dao_Moderator::isAdmin
* @throws unauthorized exception, catch the exception in error controller
*/
我已经搜索了网站上提供的整个 Zend 教程,以了解如何开始使用它!这真的让我很紧张……任何有关这方面的帮助将不胜感激。
错误处理可以用 Zend_Controller_Plugin_ErrorHandler 完成吗?
I have been learning the Zend Framework for the past couple of days. I am at the beginner level as of now.
I have been given a problem statement:
/* Create a new lead
*
* planId will be sent $_GET['planId'], the form should send the action to
* the same page
* a user should be logged in and he should be administrator of the plan
*
* @uses Plans_Model_Dao_Moderator::isAdmin
* @throws unauthorized exception, catch the exception in error controller
*/
I have searched the whole Zend tutorial available on the website to understand how to start with it! It really is getting on my nerves..any help regarding this would be grateful.
Can the error handling be done with Zend_Controller_Plugin_ErrorHandler?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,您需要设置您的应用程序。
遵循 Zend Framework 快速入门 (http://framework.zend.com /manual/en/learning.quickstart.intro.html)您最终将得到一个可通过 /index/index 访问的应用程序。
如果您认为快速启动不够,可以点击以下链接:http://alex-tech-adventures.com/development/zend- Framework.html?start=20
您将在其中找到如何使用登录、访问控制和表单来设置应用程序。
之后,您终于可以尝试了解
Plans_Model_Dao_Moderator::isAdmin
在这种情况下,有一个不同的概念。 ZF 快速入门使用数据映射器作为
DAL
(数据访问层),它与每个模型对象的DAO
(数据访问对象)配合使用。请参阅:DAO 和 DAL 之间有什么区别?
上面的链接(Alex Tech Adventures)上提供了教程,请勿使用数据映射器。这种情况下的 DAL 是 Zend_Db_Table 和 Zend_Db_Table_Row。但是当你理解了整个概念之后你就可以调整它。
所以基本上,
Plans_Model_Dao_Moderator::isAdmin
将类似于:First of all, you need to set up your application.
Following the Zend Framework Quick Start (http://framework.zend.com/manual/en/learning.quickstart.intro.html) you will end up with a single application accessible through /index/index
If you consider the quick start not sufficient, you can follow this link: http://alex-tech-adventures.com/development/zend-framework.html?start=20
There you will find how to setup the application with login, access control and also forms.
After that, you can finally try to understand the
Plans_Model_Dao_Moderator::isAdmin
In this case, there is a different concept. The ZF Quick Start uses Data Mappers as
DAL
(Data Access Layer) which act with aDAO
(Data Access Objects) for each model object.See: What is the difference between DAO and DAL?
The tutorial provided on the link above (Alex Tech Adventures), do not make use of Data Mappers. The DAL in that case is the Zend_Db_Table and Zend_Db_Table_Row. But you can adapt it after you understand the whole concept.
So basically, the
Plans_Model_Dao_Moderator::isAdmin
will be something like: