/**
* Sets a flash variable that will be passed to the very next action.
*
* @param string $name The name of the flash variable
* @param string $value The value of the flash variable
* @param bool $persist true if the flash have to persist for the following request (true by default)
*/
# execute action
$this->getUser()->setFlash('msg', 'Hello world', false);
$this->forward('otherModule', 'otherAction');
# otherActionSuccess.php
echo $sf_user->getFlash('msg');# will be printed Hello world
# execute action
$this->getUser()->setFlash('msg', 'Hello world', false);
$this->redirect('otherModule', 'otherAction');
# otherActionSuccess.php
echo $sf_user->getFlash('msg');# will be printed empty (null)
Title:
Symfony sfUser setFlash function
Description:
/** * Sets a flash variable that will be passed to the very next action. * * @param string $name The name of the flash vari...
...
Rating:
4