RedirectFinisher extends AbstractFinisher
This finisher redirects to another Controller.
Scope: frontend
Table of Contents
Properties
- $defaultOptions : array<string|int, mixed>
- These are the default options of the finisher.
- $finisherContext : FinisherContext
- $finisherIdentifier : string
- $options : array<string|int, mixed>
- The options which have been set from the outside. Instead of directly accessing them, you should rather use parseOption().
- $shortFinisherIdentifier : string
Methods
- execute() : string|null
- Executes the finisher
- getFinisherIdentifier() : string
- isEnabled() : bool
- Returns whether this finisher is enabled
- setFinisherIdentifier() : void
- setOption() : mixed
- Sets a single finisher option (@see setOptions())
- setOptions() : mixed
- addBaseUriIfNecessary() : string
- Adds the base uri if not already in place.
- executeInternal() : string|null
- Executes this finisher
- getTypoScriptFrontendController() : TypoScriptFrontendController
- parseOption() : string|array<string|int, mixed>|int|null
- Read the option called $optionName from $this->options, and parse {...} as object accessors.
- redirect() : mixed
- Redirects the request to another page.
- redirectToUri() : mixed
- Redirects the web request to another uri.
- resolveRuntimeReference() : int|string|array<string|int, mixed>
- Resolving property by name from submitted form data.
- substituteRuntimeReferences() : mixed
- You can encapsulate an option value with {}.
- translateFinisherOption() : array<string|int, mixed>|string
- Wraps TranslationService::translateFinisherOption to recursively invoke all array items of resolved form state values or nested finisher option configuration settings.
Properties
$defaultOptions
These are the default options of the finisher.
protected
array<string|int, mixed>
$defaultOptions
= ['pageUid' => 1, 'additionalParameters' => '', 'statusCode' => 303, 'fragment' => '']
$finisherContext
protected
FinisherContext
$finisherContext
$finisherIdentifier
protected
string
$finisherIdentifier
= ''
$options
The options which have been set from the outside. Instead of directly accessing them, you should rather use parseOption().
protected
array<string|int, mixed>
$options
= []
$shortFinisherIdentifier
protected
string
$shortFinisherIdentifier
= ''
Methods
execute()
Executes the finisher
public
final execute(FinisherContext $finisherContext) : string|null
Parameters
- $finisherContext : FinisherContext
-
The Finisher context that contains the current Form Runtime and Response
Return values
string|nullgetFinisherIdentifier()
public
getFinisherIdentifier() : string
Return values
stringisEnabled()
Returns whether this finisher is enabled
public
isEnabled() : bool
Return values
boolsetFinisherIdentifier()
public
setFinisherIdentifier(string $finisherIdentifier) : void
Parameters
- $finisherIdentifier : string
-
The identifier for this finisher
setOption()
Sets a single finisher option (@see setOptions())
public
setOption(string $optionName, mixed $optionValue) : mixed
Parameters
- $optionName : string
-
name of the option to be set
- $optionValue : mixed
-
value of the option
setOptions()
public
setOptions(array<string|int, mixed> $options) : mixed
Parameters
- $options : array<string|int, mixed>
-
configuration options in the format ['option1' => 'value1', 'option2' => 'value2', ...]
addBaseUriIfNecessary()
Adds the base uri if not already in place.
protected
addBaseUriIfNecessary(string $uri) : string
Parameters
- $uri : string
-
The URI
Return values
stringexecuteInternal()
Executes this finisher
protected
executeInternal() : string|null
Tags
Return values
string|nullgetTypoScriptFrontendController()
protected
getTypoScriptFrontendController() : TypoScriptFrontendController
Return values
TypoScriptFrontendControllerparseOption()
Read the option called $optionName from $this->options, and parse {...} as object accessors.
protected
parseOption(string $optionName) : string|array<string|int, mixed>|int|null
Then translate the value.
If $optionName was not found, the corresponding default option is returned (from $this->defaultOptions)
Parameters
- $optionName : string
Return values
string|array<string|int, mixed>|int|nullredirect()
Redirects the request to another page.
protected
redirect(int $pageUid, string $additionalParameters, string $fragment, int $statusCode) : mixed
Redirect will be sent to the client which then performs another request to the new URI.
NOTE: This method only supports web requests and will thrown an exception if used with other request types.
Parameters
- $pageUid : int
-
Target page uid. If NULL, the current page uid is used
- $additionalParameters : string
- $fragment : string
- $statusCode : int
-
(optional) The HTTP status code for the redirect. Default is "303 See Other
Tags
redirectToUri()
Redirects the web request to another uri.
protected
redirectToUri(string $uri[, int $statusCode = 303 ]) : mixed
NOTE: This method only supports web requests and will thrown an exception if used with other request types.
Parameters
- $uri : string
-
A string representation of a URI
- $statusCode : int = 303
-
(optional) The HTTP status code for the redirect. Default is "303 See Other
Tags
resolveRuntimeReference()
Resolving property by name from submitted form data.
protected
resolveRuntimeReference(string $property, FormRuntime $formRuntime) : int|string|array<string|int, mixed>
Parameters
- $property : string
- $formRuntime : FormRuntime
Return values
int|string|array<string|int, mixed>substituteRuntimeReferences()
You can encapsulate an option value with {}.
protected
substituteRuntimeReferences(string|array<string|int, mixed> $needle, FormRuntime $formRuntime) : mixed
This enables you to access every gettable property from the TYPO3\CMS\Form\Domain\Runtime\FormRuntime.
For example: {formState.formValues.<elementIdentifier>} or {<elementIdentifier>}
Both examples are equal to "$formRuntime->getFormState()->getFormValues()[<elementIdentifier>]" There is a special option value '{__currentTimestamp}'. This will be replaced with the current timestamp.
Parameters
- $needle : string|array<string|int, mixed>
- $formRuntime : FormRuntime
translateFinisherOption()
Wraps TranslationService::translateFinisherOption to recursively invoke all array items of resolved form state values or nested finisher option configuration settings.
protected
translateFinisherOption(string|array<string|int, mixed> $subject, FormRuntime $formRuntime, string $optionName, string|array<string|int, mixed> $optionValue, array<string|int, mixed> $translationOptions) : array<string|int, mixed>|string
Parameters
- $subject : string|array<string|int, mixed>
- $formRuntime : FormRuntime
- $optionName : string
- $optionValue : string|array<string|int, mixed>
- $translationOptions : array<string|int, mixed>