On 11/22/10 7:25 PM, Jordi Boggiano wrote:
On Mon, Nov 22, 2010 at 4:32 PM, Lukas Kahwe
Smith<[email protected]> wrote:
However in some cases you might prefer to show some flash messages
closer to a specific form. In this case one would call hasFlash()
followed by getFlash() to show the flash message in the given
template. Since getFlash() by default removes the flash message it
would not show up in a subsequent getFlashMessages() call.
getFlash() does not remove the message:
https://github.com/fabpot/symfony/blob/master/src/Symfony/Component/HttpFoundation/Session.php#L209
In general I agree, but this is not entirely realistic. In most
cases you'll want to use getFlashMessages early on, at the top of the
page or something, to display all errors.
Given the way Twig handles output (in a one-pass top-down way, not a
two-pass content-then-layout), getFlashMessages will be called
before your form's hasFlash/getFlash would be.
Cheers
--
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