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
精彩评论