Symfony\Bundle\FrameworkBundle\Controller\Controller::addFlash PHP Méthode

addFlash() protected méthode

Adds a flash message to the current session for type.
protected addFlash ( string $type, string $message )
$type string The type
$message string The message
    protected function addFlash($type, $message)
    {
        if (!$this->container->has('session')) {
            throw new \LogicException('You can not use the addFlash method if sessions are disabled.');
        }
        $this->container->get('session')->getFlashBag()->add($type, $message);
    }

Usage Example

 public function addFlash($type, $message)
 {
     parent::addFlash($type, $message);
 }
All Usage Examples Of Symfony\Bundle\FrameworkBundle\Controller\Controller::addFlash