Navigation Menu

Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

Commit

Permalink
Add form type support in FormTrait for flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lokhman authored and fabpot committed Jul 31, 2015
1 parent 136153a commit 3ffe0c7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Silex/Application/FormTrait.php
Expand Up @@ -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);
}
}

0 comments on commit 3ffe0c7

Please sign in to comment.