processFormData
The processFormData hook is triggered after a form has been submitted. It
passes the form data array, the Data Container Array and the files array as
arguments and does not expect a return value.
Parameters
array
$submittedDataForm data submitted by the visitor.
array
$formDataThe form configuration from
tl_formtable.array
$filesContains information about uploaded files (from “upload” widgets). Can be null.
array
$labelsThe field labels of the form.
\Contao\Form
$formThe form instance.
Example
// src/EventListener/ProcessFormDataListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\Form;
#[AsHook('processFormData')]
class ProcessFormDataListener
{
public function __invoke(array $submittedData, array $formData, array|null $files, array $labels, Form $form): void
{
// Do something …
}
}