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 '';
    }