Ondrej Slinták Ondrej Slinták - 1 month ago 6
PHP Question

How to set default value for form field in Symfony2?

Is there an easy way to set a default value for text form field?

Answer

Can be use during the creation easily with :

->add('myfield', 'text', array(
     'label' => 'Field',
     'data' => 'Default value'
))