Commit a95bd168 authored by Fabien Potencier's avatar Fabien Potencier

fixed compat with Symfony 2.7

parent 903d772e
...@@ -29,8 +29,13 @@ trait FormTrait ...@@ -29,8 +29,13 @@ trait FormTrait
* *
* @return FormBuilder * @return FormBuilder
*/ */
public function form($data = null, array $options = array(), $type = 'Symfony\Component\Form\Extension\Core\Type\FormType') public function form($data = null, array $options = array(), $type = null)
{ {
if (null === $type) {
// for BC with Symfony pre 2.7
$type = class_exists('Symfony\Component\Form\Extension\Core\Type\RangeType') ? 'Symfony\Component\Form\Extension\Core\Type\FormType' : 'form';
}
return $this['form.factory']->createBuilder($type, $data, $options); return $this['form.factory']->createBuilder($type, $data, $options);
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment