News Feed
Sections




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

Rob Allen:
Globally overriding validation messages for ZF2 forms
August 19, 2014 @ 10:46:27

Rob Allen has posted a quick hint about overriding validation messages in a Zend Framework v2 based application. This override is related to the output of a standard form and works globally instead of just on a single form.

One thing that I always do when creating a Zend Framework 2 form is override the validation messages for a number of validators - EmailAddress in particular. I recently decided that I should probably sort this one out once and be done with it. Turns out that it's quite easy assuming that you use the FormElementManger to instantiate your forms.

The post includes all the code you'll need to do the override: a custom validator example, the changes you'll need to make to the configuration and an example of a form that uses the custom handling. He explains each of the parts too, showing how they fit together in your module.

0 comments voice your opinion now!
zendframework2 override validation message form tutorial

Link: http://akrabat.com/zend-framework-2/globally-overriding-validation-messages-for-zf2-forms/

blog comments powered by Disqus

Similar Posts

PHPMaster.com: Testing Error Conditions with PHPUnit

Alexander Netkachev's Blog: Installing Propel object persistence layer for Web application

SitePoint.com: Be More Asssertive: Getting to Know PHPUnit's Assertions

Geeks Not Nerds Blog: Rolling your own Blog Backend from Scratch Part 1

Piotr Walczyszyn's Blog: Configuring Eclipse PDT & Flash Builder 4 Plug-in for PHP/Flex development


Community Events





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


laravel package library api zendserver community deployment introduction list opinion symfony tips release interview language podcast framework install series update

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