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 Apr 6, 2017
·
6 revisions
In some cases you might want to create a named form. The form handlers support this by also configuring a name.
<?phpnamespaceApp\FormHandler;
// use ...finalclass MyFormHandler implements HandlerTypeInterface
{
publicfunctionconfigure(HandlerConfigInterface$config)
{
$config->setType(MyType::class);
// to allow the same form on the same page multiple times$config->setName('my_custom_form_name');
$config->onSuccess(function ($data) {
// ...
});
}
}
This will internally call the FormFactoryInterface::createNamed() method with the name instead of the regular FormFactoryInterface::create().