PHP Symfony: Access the internationalization “locale”

In your controller, you can access the special global "_locale" variable from the Request object:  

Accessing cookies directly in your Symfony Twig views

In Symfony, cookies are stored in the app.request object. Here's how you access them in Twig: To see if a cookie is set, use the if statement inside Twig:

Setting invalid message within form types in Symfony using model transformers

In Symfony, you can set the parameter "invalid_message" in your form types. For example: For more about Data Transformers and what they're used for, visit the Symfony Cookbook: