First you should install the php5-intl :
1 |
sudo apt-get install php5-intl |
Then add the code below in your “app/config/config.yml” file :
1 2 3 4 5 |
services: twig.extension.intl: class: Twig_Extensions_Extension_Intl tags: - { name: twig.extension } |
Finaly in you twig file you can use the localizeddate
filter to format dates into a localized string representating the date :
1 |
{{ post.published_at|localizeddate('medium', 'none', locale) }} |
No comments yet.