vitiko / IphpFileStoreBundle

Symfony 2 file upload for doctrine entities
http://symfonydev.ru/iphpfilestorebundle/
51 stars 23 forks source link

How i can get error in twig? #34

Closed kolyadin closed 9 years ago

kolyadin commented 9 years ago

For example:

{{ form_errors(form.image) }}

does not show any errors, but

{{ form_errors(form) }}

shows errors as well

So, question is: how can i access image errors via {{ form_errors(form.image) }} in twig?

LouTerrailloune commented 9 years ago

Add 'error_bubbling' => false to option of the iphp_file field.

            ->add('picture', 'iphp_file', array(
                'required' => false,
                'label' => 'Photo',
                'error_bubbling' => false,
            ))

I don't know why it's true by default.