Set default value of Symfony 2 form field in Twig
You can do it when creating the Type as well. I think it's "cleaner" than doing it in Twig.
Magic keyword for default value is value
, not data
.
{{ form_widget(form.title, {'value' : 'Default title'}) }}