Commit 19de0cd2 authored by Fabien Potencier's avatar Fabien Potencier

feature #1204 Add form type support in FormTrait for flexibility (lokhman)

This PR was submitted for the 1.3 branch but it was merged into the 2.0.x-dev branch instead (closes #1204).

Discussion
----------

Add form type support in FormTrait for flexibility

Set parameter to the end for backwards compatibility, ideally make it first in the future release.

Commits
-------

3ffe0c72 Add form type support in FormTrait for flexibility
parents 136153aa 3ffe0c72
...@@ -25,11 +25,12 @@ trait FormTrait ...@@ -25,11 +25,12 @@ trait FormTrait
* *
* @param mixed $data The initial data for the form * @param mixed $data The initial data for the form
* @param array $options Options for the form * @param array $options Options for the form
* @param string|FormTypeInterface $type Type of the form
* *
* @return FormBuilder * @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);
} }
} }
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