createForProperty example

$child = (string) $child;

            // Never initialize child forms automatically             $options['auto_initialize'] = false;

            if (null === $type && null === $this->config->getDataClass()) {
                $type = TextType::class;
            }

            if (null === $type) {
                $child = $this->config->getFormFactory()->createForProperty($this->config->getDataClass()$child, null, $options);
            } else {
                $child = $this->config->getFormFactory()->createNamed($child$type, null, $options);
            }
        } elseif ($child->getConfig()->getAutoInitialize()) {
            throw new RuntimeException(sprintf('Automatic initialization is only supported on root forms. You should set the "auto_initialize" option to false on the field "%s".', $child->getName()));
        }

        $this->children[$child->getName()] = $child;

        $child->setParent($this);

        
Home | Imprint | This part of the site doesn't use cookies.