Felipe Weckx

Translating ZF2 validation messages

Often we use the InputFilter to validate the elements of a form create with Zend Framework 2. However, when creating a system/website which has to support multiple languages we also need to translate the validation messages. Fortunately ZF2 comes with a series of translations for the default validation classes and we can set up the translation using the \Zend\Validator\AbstractValidator::setDefaultTranslator method:

The code above has to placed inside the Module class in the modules you need to translate the messages, or in your application module to enable in all of them. Note that we added it to the onBootstrap method, which means it will be executed in all actions. That can cause a performance issue, so it is best to separate it and call only on the controllers that actually use validations.

Zend Certified Engineer Certification

Recently I upgraded my “Zend Certified Engineer PHP 5.3” to the new “Zend Certified PHP Engineer” that covers the 5.5 version of PHP. I found the exam quite similar to the previous one (I believe some questions were actually the same). But there were some new topics:

The exam level is very similiar to the previous one, but it’s nevertheless good to keep the exam up to date with the language features. The new topics are great to provoke studying and getting to know new features. The complete list of topics is available at: http://www.zend.com/en/services/certification/php-certification/.

The exam voucher can be bought at the Zend website or at Pearson Vue for $ 195. Those who already have the PHP 5.3 certification get a $ 70 discount on the exam (you have to send them an e-mail). If you pass the exam you also get a perpetual Zend Studio license.

According to the Zend website the Zend Framwork 2 certification will come out this year (at last).