[FORM] Add names to forms

This commit is contained in:
Hugo Sales 2020-09-04 19:35:41 +00:00 committed by Hugo Sales
parent adc843c1d6
commit 07078414bb
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -52,7 +52,8 @@ abstract class Form
string $type = 'Symfony\Component\Form\Extension\Core\Type\FormType', string $type = 'Symfony\Component\Form\Extension\Core\Type\FormType',
array $builder_options = []): SymfForm array $builder_options = []): SymfForm
{ {
$fb = self::$form_factory->createBuilder($type, array_merge($builder_options, ['translation_domain' => false])); $name = $form[array_key_last($form)][0];
$fb = self::$form_factory->createNamedBuilder($name, $type, array_merge($builder_options, ['translation_domain' => false]));
foreach ($form as list($key, $class, $options)) { foreach ($form as list($key, $class, $options)) {
if ($target != null && empty($options['data']) && (strstr($key, 'password') == false) && $class != SubmitType::class) { if ($target != null && empty($options['data']) && (strstr($key, 'password') == false) && $class != SubmitType::class) {
if (isset($extra_data[$key])) { if (isset($extra_data[$key])) {