Are you new? Read the FAQ and catch up on!
2k views

Calling the symfony i18n function __() in an action

Although the __() function of symfony is meant to be called in the templates, there are some times in which you may need to call that function in an action. This is the easiest way to achieve that:

PHP
  1. $this->getContext()->getI18N()->__($text, $args, 'messages');
  2.  

­

Tags: PHP symfony i18n

Embed: