FlashMessagesViewHelper

final class \TYPO3\CMS\Fluid\ViewHelpers\FlashMessagesViewHelper

Extends
AbstractViewHelper

ViewHelper which renders the flash messages (output messages / message bubbles, which can also be queued from a preceding request). No output occurs if no flash messages are queued. Output is done with a hard-coded HTML definition, but the raw contents can be extracted via the `as` attribute, and rendered with custom formatting.

  <f:flashMessages />

  <f:flashMessages as="flashMessages">
       <dl class="messages">
          <f:for each="{flashMessages}" as="flashMessage">
             <dt>{flashMessage.code}</dt>
             <dd>{flashMessage.message}</dd>
          </f:for>
       </dl>
  </f:flashMessages>

Tags

see
https://docs.typo3.org/permalink/t3viewhelper:typo3-fluid-flashmessages

Table of Contents

Properties

$escapeOutput  : bool
ViewHelper outputs HTML therefore output escaping has to be disabled

Methods

__construct()  : mixed
initializeArguments()  : void
render()  : string
Renders FlashMessages and flushes the FlashMessage queue

Properties

$escapeOutput

ViewHelper outputs HTML therefore output escaping has to be disabled

protected bool $escapeOutput = false

Methods

initializeArguments()

public initializeArguments() : void

render()

Renders FlashMessages and flushes the FlashMessage queue

public render() : string

Note: This does not disable the current page cache in order to prevent FlashMessage output from being cached. In case of conditional flash message rendering, caching must be disabled (e.g. for a controller action). Custom caching using the Caching Framework can be used in this case.

Return values

string
On this page