mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Merge pull request #314 from romainneutron/flash-messages
[3.8] Add simpler behavior for flash messages
This commit is contained in:
@@ -518,6 +518,30 @@ class Application extends SilexApplication
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a flash message for type.
|
||||
*
|
||||
* @param string $type
|
||||
* @param string $message
|
||||
*/
|
||||
public function addFlash($type, $message)
|
||||
{
|
||||
return $this['session']->getFlashBag()->add($type, $message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets and clears flash from the stack.
|
||||
*
|
||||
* @param string $type
|
||||
* @param array $default Default value if $type does not exist.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFlash($type, array $default = array())
|
||||
{
|
||||
return $this['session']->getFlashBag()->get($type, $default);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tell if current a session is open
|
||||
*
|
||||
|
Reference in New Issue
Block a user