Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. FlashBagInterface.php

interface FlashBagInterface

FlashBagInterface.

@author Drak <drak@zikula.org>

Hierarchy

  • interface \Symfony\Component\HttpFoundation\Session\SessionBagInterface
    • interface \Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface extends \Symfony\Component\HttpFoundation\Session\SessionBagInterface

Expanded class hierarchy of FlashBagInterface

All classes that implement FlashBagInterface

3 files declare their use of FlashBagInterface
FlashBagAwareSessionInterface.php in vendor/symfony/http-foundation/Session/FlashBagAwareSessionInterface.php
Messenger.php in core/lib/Drupal/Core/Messenger/Messenger.php
Session.php in vendor/symfony/http-foundation/Session/Session.php

File

vendor/symfony/http-foundation/Session/Flash/FlashBagInterface.php, line 21

Namespace

Symfony\Component\HttpFoundation\Session\Flash
View source
interface FlashBagInterface extends SessionBagInterface {
    
    /**
     * Adds a flash message for the given type.
     */
    public function add(string $type, mixed $message) : void;
    
    /**
     * Registers one or more messages for a given type.
     */
    public function set(string $type, string|array $messages) : void;
    
    /**
     * Gets flash messages for a given type.
     *
     * @param string $type    Message category type
     * @param array  $default Default value if $type does not exist
     */
    public function peek(string $type, array $default = []) : array;
    
    /**
     * Gets all flash messages.
     */
    public function peekAll() : array;
    
    /**
     * Gets and clears flash from the stack.
     *
     * @param array $default Default value if $type does not exist
     */
    public function get(string $type, array $default = []) : array;
    
    /**
     * Gets and clears flashes from the stack.
     */
    public function all() : array;
    
    /**
     * Sets all flash messages.
     */
    public function setAll(array $messages) : void;
    
    /**
     * Has flash messages for a given type?
     */
    public function has(string $type) : bool;
    
    /**
     * Returns a list of all defined types.
     */
    public function keys() : array;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
FlashBagInterface::add public function Adds a flash message for the given type. 2
FlashBagInterface::all public function Gets and clears flashes from the stack. 2
FlashBagInterface::get public function Gets and clears flash from the stack. 2
FlashBagInterface::has public function Has flash messages for a given type? 2
FlashBagInterface::keys public function Returns a list of all defined types. 2
FlashBagInterface::peek public function Gets flash messages for a given type. 2
FlashBagInterface::peekAll public function Gets all flash messages. 2
FlashBagInterface::set public function Registers one or more messages for a given type. 2
FlashBagInterface::setAll public function Sets all flash messages. 2
SessionBagInterface::clear public function Clears out data from bag. 5
SessionBagInterface::getName public function Gets this bag&#039;s name. 5
SessionBagInterface::getStorageKey public function Gets the storage key for this bag. 5
SessionBagInterface::initialize public function Initializes the Bag. 5

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal