Thursday, May 26, 2011

Error display on FileType form field with Symfony2

By default, error_bubbling is false on all form fields in Symfony2. All but FileType (and some others ?) !


So if you don't want error_bubbling, don't forget to explicitely specify if as following :

$builder->add('myFileField', 'file', array ('label' => 'myform.upload.label', 'error_bubbling' => false));