On 27.11.2010, at 16:33, Lukas Kahwe Smith wrote:
> Hi,
>
> So I guess it was my fault for not attending the meeting, but I am not
> entirely happy with the outcome:
>
> 1) i think there need to be methods for removeFlash() and clearFlashes()
> removeFlash() is useful for removing flashes from trigger happy 3rd party
> Bundles, but also for those who want to output flash messages in particular
> locations, while using getFlashes() to display the rest in a central
> location. note that the later doesnt work in twig since it starts the
> rendering in the layout. but that is just one of many approaches supported by
> Symfony2.
>
> clearFlashes() use cases can also be when for some reason you want to for
> example redirect flash messages in some cases to email. we would also like to
> have it for the view layer so that in the non HTML case where we follow
> internal redirects immediately we can clear flash messages since in most
> cases you will not want them at all:
> https://github.com/fabpot/symfony/pull/200#L2R214
>
> we already implemented this as part of
> https://github.com/fabpot/symfony/pull/198
>
> 2) i still think there should be an explicit type parameter and that it
> should additionally encourage reuse of the same "types" (for example by
> mapping integer constants to types). i think it would be a really idea to
> just overwrite previous flash messages in case for some reason one might in
> fact have several messages of the same type. so if we do not want to add a
> separate type field, then we would have to find some handling to stack
> multiple messages for a given key.
I also just noticed that there doesnt seem to be a good way to get all the
flashes to show them in the layout. Right now I only see the following:
{% for key, flash in _view.session.get('_flash') %}
<div class="{{ flash }}">
{% trans key from 'FooBundle' %}
</div>
{% endfor %}
regards,
Lukas Kahwe Smith
[email protected]
--
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