News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Jani Hartikainen's Blog:
Validating Zend_Forms using model objects
May 08, 2009 @ 10:27:30

Jani Hartikainen has posted a three-step process to his blog about handling the information submitted into a Zend_Form instance with a model.

Zend_Forms, models, validation and how they all work together is a tricky topic. There are many opinions and many ways to do it. This time I'll show you what I think could be the answer to validating forms without having to duplicate validation code both in a model class and in your form.

He creates a simple model interface (with get, set, isValid and getMessages methods) and a validator extended from Zend_Validate_Abstract to pass the information back into the model through an isValid method call. The validator is then added to each element you want to use it on in the addElement call on the Zend_Form object.

0 comments voice your opinion now!
validate zendform model object validator isvalid addelement zendframework


blog comments powered by Disqus

Similar Posts

Till Klampaeckel's Blog: Zend Framework: Writing an IN-Clause with Zend_Db

Brian Swan's Blog: Using the Zend Framework and the PDO_SQLSRV Driver

Lee Davis' Blog: FormFactory - Driving Doctrine 1.2 / 2.x Mappings into Zend_Form objects

Tony Bibbs' Blog: Geeklog_Generator 1.0.0 Released

Jim Wynia's Blog: Tracking Accomplishments with PHP, Google Calendar and Zend Framework


Community Events





Don't see your event here?
Let us know!


application threedevsandamaybe list language bugfix series interview library laravel wordpress code release introduction developer unittest api community install configure podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework