Symfony2.5 maxlength is deprecated

I would like to know why the max_length in the form type is deprecated?

enter image description here

And how to achieve the desired effect in the cleanest way now?

+3


source to share


1 answer


See the related issue on Github. This option only adds the html attribute to the textarea. You can manually add it via attributes:



$builder->add('field', 'textarea', array(
    'attr' => array('maxlength' => 255),
));

      

+6


source







All Articles