Copied!

ActionDispatcherInterface

ActionDispatcherInterface.php : 20

Form action dispatchers can be used to abstract actions when a complex form is submitted.

Typical example is a multiple actions based form, with multiple submit buttons, where actions to take depend on which submit button is clicked.

This would basically help reducing the amount of code in the controller receiving the form submission request.

Methods

publicdispatchFormAction()

ActionDispatcherInterface.php : 31

Dispatches the action of a given form.

public dispatchFormAction(FormInterface $form, ValueObject $data[, string|null $actionName = null ][, array<string|int, mixed> $options = [] ]) : mixed

Parameters

Name Type Default value Description
$form FormInterface -

the form that has been submitted

$data ValueObject -

Underlying data for the form. Most likely a create or update struct.

$actionName string|null null

The form action itself. Typically the form clicked button name, or null if the default action is used (e.g. when pressing enter).

$options array<string|int, mixed> []

arbitrary hash of options

publicgetResponse()

ActionDispatcherInterface.php : 38

Returns the generated response, if any. Typically a RedirectResponse.

public getResponse() : Response|null

Return values

Response|null