简体   繁体   中英

Symfony2 Form Widget Date

i have a problem with a widget date in a Symfony form, i have this code

->add('borndate', 'birthday', array(
                'widget' => 'choice',
                'attr'  => array(
                    'class' => 'form-control'
                ),
                'label' => 'user.birthday.label',
                'input' => 'string',
                'format' => 'yyyy.MM.dd',
                'empty_value' => array('year' => 'user.birthday.year', 'month' => 'user.birthday.month', 'day' => 'user.birthday.day'),
                'data' => '1950-01-01'
            ))

Now i have this type of format in my form: 1950 - 01 - 01 but i would this format 01 - 01- 1950 and print in a select the value of my db? How can i do for solved this two problems?? Thanks and sorry for my bad english :)

Probably:

/***/
'format' => 'dd-MM-yyyy'
/***/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM