Set default value of Symfony 2 form field in Twig Set default value of Symfony 2 form field in Twig symfony symfony

Set default value of Symfony 2 form field in Twig


Magic keyword for default value is value, not data.

{{ form_widget(form.title, {'value' : 'Default title'}) }}


You can do it when creating the Type as well. I think it's "cleaner" than doing it in Twig.