symfony - How can I add an extra option in the dropdown generated by form? -


i've form builder this:

public function buildform(formbuilderinterface $builder, array $options) {     $builder         ->add('file','file')         ->add('concurs','entity', array('class' => 'mcfrontendbundle:concurs'))     ; } 

as can see, shows input select file, , dropdown select option filled concurs entity.

can add manually option "none"?

the entity form type, or particular choice types, has option called empty_value, need.

public function buildform(formbuilderinterface $builder, array $options) {     $builder         ->add('file','file')         ->add('concurs','entity', array(             'class' => 'mcfrontendbundle:concurs',             'empty_value' => 'none',             'required' => false         ))     ; } 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -