php - symfony2 form builder date type -
i'm building booking system hotel website contains rezervations ability. rezervations form contains name, last name etc... , date of arrival , date of departure. 'date' type in form builder constructs 3 select tags; month, day, year in order. customize in various ways.
i change order of select tags be: days, months, years. change default english months local ones (i'm croatian).
so, how do in createformbuilder() funciton? tried adding 'choice' keys parameter array, keeps sending errors expected parameter long string given.
also, advice welcome worked dates in forms in symfony2, pitfalls, common mistakes, should use or should not, stuff that.
this you're looking fore
$builder->add('date_field', 'date', array( 'format' => 'dd-mm-yyyy', ));
moreover can add various type of customization date_field
field such have not 3 differents selects 1 , on.
take here
Comments
Post a Comment