public function addFlash($type, $message)
    {
        if (!in_array($type, self::$flashTypes)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid flash message type `%s`, valid type are %s', $type, implode(', ', self::$flashTypes)
            ));
        }

        $this['session']->getFlashBag()->add($type, $message);

        return $this;
    }
public function addFlash($type, $message)
    {
        if (!in_array($type, self::$flashTypes)) {
            throw new InvalidArgumentException(sprintf(
                'Invalid flash message type `%s`, valid type are %s', $type, implode(', ', self::$flashTypes)
            ));
        }

        $this['session']->getFlashBag()->add($type, $message);

        return $this;
    }
public function addFlash ( $ type , $ message ) { if ( ! in_array ( $ type , self :: $ flashTypes ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid flash message type `%s`, valid type are %s' , $ type , implode ( ', ' , self :: $ flashTypes ) ) ) ; } $ this [ 'session' ] -> getFlashBag ( ) -> add ( $ type , $ message ) ; return $ this ; }
Adds a flash message for type.

In Phraseanet, valid types are "warning", "info", "success" and "error"

@param string $type
@param string $message

@return Application

@throws InvalidArgumentException In case the type is not valid
Adds a flash message for type .