Format date in the indexSuccess.php

后端 未结 4 1691
礼貌的吻别
礼貌的吻别 2021-01-20 14:53

I want to format the created_at field date from the original for something like 03.May.2011 to be shown in the indexSuccess.php and in the sh

4条回答
  •  萌比男神i
    2021-01-20 15:35

    The format of some data absolutely not belongs into controller context - so please use

    use_helper("date");
    echo format_date($myDate);
    

    from symfony's date helper in your template (showSuccess.php, blaSuccess.php) or partial (form.php, list.php, test.php) !

    You'll find more informations here http://www.symfony-project.org/gentle-introduction/1_4/en/13-I18n-and-L10n#chapter_13_sub_outputting_data_in_the_user_s_culture or in the source file.

提交回复
热议问题