Closed
Closed
Copy link
Description
Form type:
use Symfony\Component\Form\AbstractType;
class ModifySettingsForm extends AbstractType {
public function getBlockPrefix() {
return 'modifySettings';
}
}
Now calling
$this->get('form.factory')->createNamed('modifySettings', ModifySettingsForm::class)
$this->createForm(ModifySettingsForm::class)
in a controller leads to different results when rendering the template. While in the 1st case the form name actually is modifySettings
, it is modify_settings_form
in the 2nd case, so the block prefix is ignored and the name is generated using the class name.