public function getFlashMessage($params, $content, \Smarty_Internal_Template $template, &$repeat)
    {
        $type = $this->getParam($params, 'type', false);

        if (null === $content) {
            $this->results = new FlashMessageBag();

            if (false === $type) {
                $this->results->addAll($this->getSession()->getFlashBag()->all());
            } else {
                $this->results->add(
                    $type,
                    $this->getSession()->getFlashBag()->get($type, [])
                );
            }

            if ($this->results->isEmpty()) {
                $repeat = false;
            }
        } else {
            $this->results->next();
        }

        if ($this->results->valid()) {
            $message = $this->results->current();
            $template->assign("TYPE", $message["type"]);
            $template->assign("MESSAGE", $message["message"]);

            $repeat = true;
        }

        if ($content !== null) {
            if ($this->results->isEmpty()) {
                $content = "";
            }

            return $content;
        }

        return '';
    }
public function getFlashMessage($params, $content, \Smarty_Internal_Template $template, &$repeat)
    {
        $type = $this->getParam($params, 'type', false);

        if (null === $content) {
            $this->results = new FlashMessageBag();

            if (false === $type) {
                $this->results->addAll($this->getSession()->getFlashBag()->all());
            } else {
                $this->results->add(
                    $type,
                    $this->getSession()->getFlashBag()->get($type, [])
                );
            }

            if ($this->results->isEmpty()) {
                $repeat = false;
            }
        } else {
            $this->results->next();
        }

        if ($this->results->valid()) {
            $message = $this->results->current();
            $template->assign("TYPE", $message["type"]);
            $template->assign("MESSAGE", $message["message"]);

            $repeat = true;
        }

        if ($content !== null) {
            if ($this->results->isEmpty()) {
                $content = "";
            }

            return $content;
        }

        return '';
    }
public function getFlashMessage ( $ params , $ content , \ Smarty_Internal_Template $ template , & $ repeat ) { $ type = $ this -> getParam ( $ params , 'type' , false ) ; if ( null === $ content ) { $ this -> results = new FlashMessageBag ( ) ; if ( false === $ type ) { $ this -> results -> addAll ( $ this -> getSession ( ) -> getFlashBag ( ) -> all ( ) ) ; } else { $ this -> results -> add ( $ type , $ this -> getSession ( ) -> getFlashBag ( ) -> get ( $ type , [ ] ) ) ; } if ( $ this -> results -> isEmpty ( ) ) { $ repeat = false ; } } else { $ this -> results -> next ( ) ; } if ( $ this -> results -> valid ( ) ) { $ message = $ this -> results -> current ( ) ; $ template -> assign ( "TYPE" , $ message [ "type" ] ) ; $ template -> assign ( "MESSAGE" , $ message [ "message" ] ) ; $ repeat = true ; } if ( $ content !== null ) { if ( $ this -> results -> isEmpty ( ) ) { $ content = "" ; } return $ content ; } return '' ; }
Get FlashMessage
And clean session from this key

@param array $params Block parameters
@param mixed $content Block content
@param \Smarty_Internal_Template $template Template
@param bool $repeat Control how many times
the block is displayed

@return mixed
Get FlashMessage And clean session from this key