Top menu

How to use the Intl Extension Twig for date

First you should install the php5-intl :

Then add the code below in your “app/config/config.yml” file :

Finaly in you twig file you can use the localizeddate filter to format dates into a localized string representating the date :



How to use the “getDefaultOptions” to initialize a form field value

In this article I will show you how to create a form by setting a field on a passed value from controller using the getDefaultOptions function :

Now in the controller we can create the form with a default value for the option “userType” that allow us to define the value of the  : […]


How to add no mapped field in form

If you wish the field to be ignored when reading or writing to the object, you can set the property_path option to false.

NB : Since 2.1, the mapped option has been added for this use-case.