Reputation: 63
My target is to create a custom Date field (which should work with Doctrine). The main difference with the basic Symfony's one is that it shouldn't be 3 dropdowns, but one <input type="date">
.
I've tried several tutorials like Symfony's book and some helpful answers here.
However the more solutions I try to embed, the more problems I see.
Could anybody write or advise the tutorial for this task?
Thanks in advance.
Upvotes: 4
Views: 1937
Reputation: 27618
In Symfony >= 2.6 they introduced a html5
option which will generate a HTML5 input element.
You can see the documentation here: http://symfony.com/doc/current/reference/forms/types/date.html#html5
Upvotes: 0
Reputation: 44831
The date field type supports that already. Just set the widget
option to single_text
and voila — you'll have what you want. No need to create a special type for that. :)
Upvotes: 6