cambraca
cambraca

Reputation: 27839

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.

Upvotes: 3

Views: 305

Answers (1)

David Weinraub
David Weinraub

Reputation: 14184

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

Upvotes: 4

Related Questions