开发者

Using Zend_Form to do validation in view and model

In this book (the link goes to the part I'm interested in) it is suggested that you could use a single instance of Zend_开发者_运维百科Form to put both Model and View validations. I'm wondering exactly how to do this, considering the forms will probably not correspond exactly to the structure of the models. How can this be achieved? It sounds logical to not duplicate the code that does validation, but I have always done it separately.


This article from ZF Project Lead Matthew Weier O'Phinney explains one approach:

http://weierophinney.net/matthew/archives/200-Using-Zend_Form-in-Your-Models.html

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜