No options are passed to getParent() of FormTypeInterface anymore. If
you previously dynamically inherited from FormType or FieldType, you can now
dynamically set the "compound" option instead.
Before:
public function getParent(array $options)
{
return $options['expanded'] ? 'form' : 'field';
}
After:
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\OptionsResolver\Options;
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$compound = function (Options $options) {
return $options['expanded'];
};
$resolver->setDefaults(array(
'compound' => $compound,
));
}
public function getParent()
{
return 'form';
}
The new method setDefaultOptions is described in the section "Deprecations".
No options are passed to
getParent()
ofFormTypeInterface
anymore. If you previously dynamically inherited fromFormType
orFieldType
, you can now dynamically set the "compound" option instead.Before:
After:
The new method
setDefaultOptions
is described in the section "Deprecations".