compatibility with older Form component versions
This commit is contained in:
parent
a8c3b234a7
commit
01ad7671bc
@ -260,7 +260,16 @@ class Controller extends ContainerAware
|
||||
*/
|
||||
public function createFormBuilder($data = null, array $options = array())
|
||||
{
|
||||
return $this->container->get('form.factory')->createBuilder('Symfony\Component\Form\Extension\Core\Type\FormType', $data, $options);
|
||||
if (method_exists('Symfony\Component\Form\AbstractType', 'getBlockPrefix')) {
|
||||
$type = 'Symfony\Component\Form\Extension\Core\Type\FormType';
|
||||
} else {
|
||||
// not using the class name is deprecated since Symfony 2.8 and
|
||||
// is only used for backwards compatibility with older versions
|
||||
// of the Form component
|
||||
$type = 'form';
|
||||
}
|
||||
|
||||
return $this->container->get('form.factory')->createBuilder($type, $data, $options);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user