Create a FlashMessage and register it to the queue

Convenience method to allow for a fluent interface

@var string $message
@param string $type
@param string $method
@return FlashMessage
971964
public function flashMessage(
        $message,
        $type = FlashMessage::TYPE_SUCCESS,
        $method = FlashMessage::METHOD_APPEND
    ) {
        $message = new FlashMessage($message, $type, $method);
        $this->register($message);

        return $message;
    }
131919
protected function addFlash(string $type, string $message)
    {
        if (!$this->container->has('session')) {
            throw new \LogicException('You can not use the addFlash method if sessions are disabled. Enable them in "config/packages/framework.yaml".');
        }

        $this->container->get('session')->getFlashBag()->add($type, $message);
    }
611998
public function set($type, $message)
    {
        $type = StaticFilter::filter('number', $type);
        if ($type < 0 || $type > 3) {
            $type = static::TYPE_INFO;
        }
        self::$messages[$type][] = $message;
        $this->getSessionDriver()
            ->set('_messages_', self::$messages)
        ;
        return $this;
    }
320273
public static function addMessage($message, $type = 'default')
    {
        if (is_array($message)) {
            foreach ($message as $msg) {
                static::addMessage($msg);
            }

            return;
        }

        try {
            $collector = static::getInstance();
        } catch (\UnexpectedValueException $e) {
            return;
        }

        $data = $collector['debug.messages'];

        if ($data === null) {
            $data = [];
        }

        $data[] = [
            'message' => $message,
            'type' => $type,
            'timestamp' => microtime(true),
        ];

        $collector['debug.messages'] = $data;
    }
542009
public function flashMessage($message, $type = 'default', $comment=null, $icon=null, $width=50, $iconSize="lg", $timeout=5)
    {
        $id = $this->getParameterId('flash');
        $presenter = $this->getPresenter();
        if($presenter instanceof Presenter){
            $messages = $presenter->getFlashSession()->$id;
        } else {
            $messages = null;
        }

        $messages[] = $flash = (object) [
             'title' => $message,
             'type' => $type,
             'comment' => $comment,
             'icon' => $icon,
             'width' => $width,
             'iconSize' =>$iconSize,
             'timeout' => $timeout
         ];
        $this->getTemplate()->flashes = $messages;
        if($presenter instanceof Presenter){
            $presenter->getFlashSession()->$id = $messages;
        }
        return $flash;
    }
826969
public function flash($message, $status = 'error', $redirect = null) {
        return $this->message($message, $status, $redirect, 'flash');
    }
839170
protected function addFlashMessage($type, $transKey, $transOpts = array(), $domain = 'messages')
    {
        $this->get('session')
            ->getFlashBag()
            ->add(
                $type,
                $this->get('translator')->trans($transKey, $transOpts, $domain)
            );
    }
520078
private function createMessageObject(string $type, string $message): Notification
    {
        $msg = new Notification();

        $msg->setType($type);
        $msg->setMessage($message);

        $this->handler->add($msg);

        return $msg;
    }
1341351
protected function message($message = null, array $params = null, $type = 'message')
    {
        return is_array($params) ? strtr(isset($this->$type) ? $this->$type : $message, $params) : $message;
    }
22664
public function addMessage($messages, $type = Bootstrap::MSG_INFO)
    {
        if (!$this->mute) {
            $this->app->addMessage($messages, $type);
        }

        return $this;
    }
597264
public function addFlashMessage(FlashMessage $flashMessage)
    {
        $flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
        $flashMessageQueue = $flashMessageService->getMessageQueueByIdentifier($this->messageQueueByIdentifier);
        $flashMessageQueue->enqueue($flashMessage);
    }
259990
public function add($message, $type, $group = '0')
    {
        if (! is_array($message)) {
            $message = [$message];
        }

        $this->populateMessages($message, $type, $group);

        session()->flash($this->session_key, $this->messages);

        return $this;
    }
1165226
public void addMessageNow(String message) {
    ActionMessages messages = (ActionMessages) now.get(Flash.MESSAGES);
    if (null == messages) {
      messages = new ActionMessages();
      now.put(Flash.MESSAGES, messages);
    }
    messages.getMessages().add(message);
  }
365229
public function addMessage($messages, $type = 'info')
    {
        $this->session->getFlashBag()->add($messages, $type);

        return $this;
    }
612239
public function message($type, $message)
    {
        if (isset($this->cssClasses[$type])) {
            $html = '<div class="%s">%s</div>';
            $this->messages[] = sprintf($html, $this->cssClasses[$type], $message);
            $this->session->set($this->flashKey, $this->messages);
        }
    }
305127
protected function setFlash($type,$message,$parameters = array(),$domain = 'flashes')
    {
        return $this->container->get('session')->getBag('flashes')->add($type,$message);
    }
1252272
public function add($type, $message, $title = null)
    {
        $notifications = $this->getNotifications();

        $notifications[] = [
            'type'    => $type,
            'message' => $message,
            'title'   => $title
        ];

        $this->session->flash(self::SESSION_KEY, $notifications);
    }