PreSubmitEvent
extends FormEvent
in package
FinalYes
This event is dispatched at the beginning of the Form::submit() method.
It can be used to:
- Change data from the request, before submitting the data to the form.
- Add or remove form fields, before submitting the data to the form.
Table of Contents
Properties
- $data : mixed
- $form : mixed
- $propagationStopped : bool
Methods
- __construct() : mixed
- getData() : mixed
- Returns the data associated with this event.
- getForm() : FormInterface
- Returns the form at the source of the event.
- isPropagationStopped() : bool
- Is propagation stopped?
- setData() : mixed
- Allows updating with some filtered data.
- stopPropagation() : void
- Stops the propagation of the event to further event listeners.
Properties
$data
protected
mixed
$data
$form
private
mixed
$form
$propagationStopped
private
bool
$propagationStopped
= false
Methods
__construct()
public
__construct(FormInterface $form, mixed $data) : mixed
Parameters
- $form : FormInterface
- $data : mixed
getData()
Returns the data associated with this event.
public
getData() : mixed
getForm()
Returns the form at the source of the event.
public
getForm() : FormInterface
Return values
FormInterfaceisPropagationStopped()
Is propagation stopped?
public
isPropagationStopped() : bool
Return values
bool —True if the Event is complete and no further listeners should be called. False to continue calling listeners.
setData()
Allows updating with some filtered data.
public
setData(mixed $data) : mixed
Parameters
- $data : mixed
stopPropagation()
Stops the propagation of the event to further event listeners.
public
stopPropagation() : void
If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation().