开发者

Using Zend_Form to do validation in view and model

开发者 https://www.devze.com 2023-02-12 14:00 出处:网络
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 exac

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

精彩评论

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