diff --git a/src/Silex/Application/FormTrait.php b/src/Silex/Application/FormTrait.php index 4744c8031..642f0b1ce 100644 --- a/src/Silex/Application/FormTrait.php +++ b/src/Silex/Application/FormTrait.php @@ -23,13 +23,14 @@ trait FormTrait /** * Creates and returns a form builder instance. * - * @param mixed $data The initial data for the form - * @param array $options Options for the form + * @param mixed $data The initial data for the form + * @param array $options Options for the form + * @param string|FormTypeInterface $type Type of the form * * @return FormBuilder */ - public function form($data = null, array $options = array()) + public function form($data = null, array $options = array(), $type = 'form') { - return $this['form.factory']->createBuilder('form', $data, $options); + return $this['form.factory']->createBuilder($type, $data, $options); } }