Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
a95bd168
Commit
a95bd168
authored
Sep 08, 2015
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed compat with Symfony 2.7
parent
903d772e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
src/Silex/Application/FormTrait.php
src/Silex/Application/FormTrait.php
+6
-1
No files found.
src/Silex/Application/FormTrait.php
View file @
a95bd168
...
@@ -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
);
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment