FlashMessage finisher 

The "FlashMessage finisher" is a basic finisher that adds a message to the FlashMessageContainer.

Options of the confirmation finisher 

The following options can be set directly in the form definition YAML or programmatically in the options array:

messageBody

messageBody
Type
string
Required

true

The flash message to be displayed. May contain placeholders like %s that are replaced with the messageArguments.

messageTitle

messageTitle
Type
string
Default
''

If set is displayed as the title of the flash message.

messageArguments

messageArguments
Type
array
Default
[]

If the messageBody contains placeholders like %s they can be replaced with these arguments.

messageCode

messageCode
Type
?int
Default
null

A unique code to make the message recognizable. By convention the current unix time stamp at the time of initially creating the message is used, for example 1758455932.

severity

severity
Type
\TYPO3\CMS\Core\Type\ContextualFeedbackSeverity
Default
ContextualFeedbackSeverity::OK

The severity influences the display (color and icon) of the flash message.

FlashMessage finisher in the YAML form definition 

public/fileadmin/forms/my_form.yaml
identifier: example-form
label: 'example'
type: Form

finishers:
  -
    identifier: SaveToDatabase
    options:
      table: 'fe_users'
      mode: update
      whereClause:
        uid: 1
      databaseColumnMappings:
        tstamp:
          value: '{__currentTimestamp}'
        pid:
          value: 1
      elements:
        textfield-identifier-1:
          mapOnDatabaseColumn: 'first_name'
        textfield-identifier-2:
          mapOnDatabaseColumn: 'last_name'
        textfield-identifier-3:
          mapOnDatabaseColumn: 'username'
        advancedpassword-1:
          mapOnDatabaseColumn: 'password'
          skipIfValueIsEmpty: true
          hashed: true
Copied!

Usage of the FlashMessage finisher in PHP code 

Developers can create a confirmation finisher by using the key FlashMessage:

<?php

use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Form\Domain\Finishers\ClosureFinisher;
use TYPO3\CMS\Form\Domain\Model\FormDefinition;
class SomeClass
{
    private function addDeleteUploadsFinisherWithMessage(FormDefinition $formDefinition, string $message)
    {
        $formDefinition->createFinisher('DeleteUploads');
    }
}
Copied!

This finisher is implemented in \TYPO3\CMS\Form\Domain\Finishers\FlashMessageFinisher .