I create a form using Symfony2:
$builder
->add('days', 'date', array(
'widget' => 'choice',
'format' => 'dd-MM-yyyy',
'pattern' => '{{ day }}-{{ month }}-{{ year }}',
'years' => range(Date('Y'), 2010),
'label' => 'Inactive participants since',
'input' => 'string',
));
But I want to show the default date, for example, today, so when I print the form, I see
02 - 05 - 2012
Any idea?
source
share