This forum has moved to a new location and is in read-only mode. Please visit to access the new location.


hi everyone! I noticed that the Form number type is not available from twig, {{ form_number(...) }} give an error and I have to use the basic form_text().

What is the best way to add it? mention that it should be available in twig but it's not

Last updated


Just stumbled across this too.

Currently I am using a simple

<input type="number" id="...

Element, but I have problem getting the input into the field after validation. I'm returning to the form with


But I am unable to access the inputs value for my given field. Neither of those work

{{ input('my_id') }}
{{ input.get('my_id') }}
{{ input.old('my_id') }}

Sadly the documentation is not very clear about how to access the data.


After a bit more digging I've found a solution. There is a function called form_value which returns the data associated with the form.

<input type="number" id="my_id" value="{{ form_value('my_id') }}" />

1-3 of 3

You cannot edit posts or make replies: the forum has moved to