ZF2-314: setDefaultTranslator() method not exist
Description
hi
i updated the lib to zf2 b4
there is no setDefaultTranslator anymore
how can i inject the translator to zend form ?
hi
i updated the lib to zf2 b4
there is no setDefaultTranslator anymore
how can i inject the translator to zend form ?
Comments
Posted by Frank Brückner (frosch) on 2012-05-25T10:02:01.000+0000
Do we really need a translator object in a form? I think the right place would be the view layer.
Posted by Matthew Weier O'Phinney (matthew) on 2012-05-27T21:55:29.000+0000
Zend\Form was completely re-written for beta4. There is no translation awareness, as the Form component is simply a bridge between model (specifically, filtering, via the new InputFilter component) and view. If you need to translate labels or other form-related output, this should be done in the view layer. We could potentially make the various form view helpers translation aware for this purpose -- but, again, this would be in the view layer, not in the Form component itself.
Posted by Paulo Assis (assisp) on 2012-05-30T09:32:53.000+0000
Hi, I've solved this (for the error messages) with: \Zend\Validator\AbstractValidator::setDefaultTranslator($translator);