You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iltar van der Berg edited this page Nov 1, 2017
·
2 revisions
The onSuccess and onFailure callback can be used to process the submitted data. In the case that the data was valid (i.e., no form errors) the onSuccess will be called. If the form was submitted but the data wasn't valid, the onFailure will be called. This way it is possible to always handle the form.
The signature for both these callbacks is:
useSymfony\Component\Form\FormInterface;
useSymfony\Component\HttpFoundation\Request;
function (mixed$data, FormInterface$form, Request$request): void;
However, since these are callbacks and passing additional arguments is allowed in PHP you will most likely only need the $data parameter.