Redirect finisher
This finisher redirects the user to a particular page after the form has been submitted. Parameters can be added to the URL.
Table of contents
Important
Finishers are executed in the order defined in your form definition. This finisher stops the execution of all subsequent finishers in order to perform the redirect. Therefore, this finisher should always be the last finisher to be executed. Finishers placed after this one in the form definition will be ignored.
Redirect finisher options
Page: [pageUid]
-
- Type
- int
- Required
true
- Default
1
ID of the page to redirect to. Button Page can be used to select a page from the page tree.
Additional parameters: [additionalParameters]
-
- Type
- string
- Default
''
URL parameters which will be appended to the URL.
URL fragment: [fragment]
-
- Type
- string
- Default
''
ID of a content element identifier or a custom fragment identifier. This will be appended to the URL and used as section anchor.
Adds a fragment (e.g.
#c9or#foo) to the redirect link. The#character can be omitted.
Additional redirect finisher options
These options can be set in the form definition YAML or programmatically in the options array. They cannot be set in the backend form editor:
delay
-
- Type
- int
- Default
0
The redirect delay in seconds.
statusCode
-
- Type
- int
- Default
303
The HTTP status code for the redirect. Default is "303 See Other".
translation.propertiesExcludedFromTranslation
-
- Type
- array
- Default
[]
Defines a list of finisher option properties to be excluded from translation.
If set, these properties are not processed by the
Translationduring translation. This prevents their values from being replaced by translated equivalents, even if translations exist for those options.Service This option is usually generated automatically shen FlexForm overrides are in place and normally does not need to be set manually in the form definition.
See Skip translation of overridden form finisher options for an example.
Redirect finisher in a YAML form definition
Example: Load the redirect finisher last
identifier: contact
type: Form
prototypeName: standard
finishers:
-
identifier: EmailToSender
options:
subject: 'Your Message: {message}'
## ...
-
identifier: DeleteUploads
-
# Attention! The Redirect finisher stops the execution of all finishers
identifier: Redirect
options:
pageUid: 1
additionalParameters: 'param1=value1¶m2=value2'
Using a Redirect finisher in PHP code
Developers can use the finisher key Redirect to create redirect finishers in their own classes:
<?php
use TYPO3\CMS\Form\Domain\Model\FormDefinition;
class SomeClass
{
private function addRedirectFinisher(FormDefinition $formDefinition)
{
$formDefinition->createFinisher('Redirect', [
'pageUid' => 1,
'additionalParameters' => 'param1=value1¶m2=value2',
]);
}
}
This finisher is implemented in
\TYPO3\.