Tag Archives: zf

Password confirmation using Zend Form and Validators

A while back i needed a password confirmation field for my users. I looked and found this neat little snippet. I cant remember who created it originally so i cant give credits to the person but its quite easy to use. Just add this to your library and create a new validator object like this.

This would be in your form where you want to have password confirmation.

On ZF’s Data Models

Michelangelo van Dam wrote a great post on Zend Frameworks data models. A lot of great pointers on how to create referencemaps between models without using any complex ORMs. The data mapper approach is a lot of work but it gives you a lot of great flexibility in the long run. Take a look at http://www.dragonbe.com/2010/01/zend-framework-data-models.html

Setup Zend_Rest_Route with multiple modules

Say you have an application and you want entire modules or just a controller to be treated and follow the RESTful ways you can do following in your bootstrap.php:

As you can see the 3th argument of `Zend_Rest_Route` will set “module”, or “module” => “controller”. Quite useful if you have an api module you want to treat as RESTful, or maybe a controller in a specific module used for some ajax stuff.