On 22.10.2010 10:21, Antoine Hérault wrote:
> Maybe it would be interesting to create a management system based on a
> flashes 
> registry (another configuration file). Thus, the controller simply pass
> the key of the 
> wanted flash message.
> 
> In the template side, a helper would display the message corresponding to a
> specified key.

I don't really get the need to add that while you can just use the key
for translations, in which case all the tools are already there, i.e.:

$this['session']->setFlash('doctrine_user_group_create/success',
'group_create_success');

Then in the view

{% if _view.session.hasFlash('doctrine_user_group_create/success') %}
<div class="doctrine_user_user_create_success">
   {% trans _view.session.getFlash('doctrine_user_group_create/success')
from DoctrineUserBundle %}
</div>
{% endif %}

Then in your language files you map group_create_success to "The group
was created successfully", and that is done with the
"DoctrineUserBundle" namespace, so you can easily override it in your
project if you're not happy with the default text provided, and it won't
conflict with your own translations.

Cheers

-- 
Jordi Boggiano
@seldaek :: http://seld.be/

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en

Reply via email to