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
cd4d3edb
Commit
cd4d3edb
authored
May 03, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated FormExtension
parent
90f94550
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/Silex/Extension/FormExtension.php
src/Silex/Extension/FormExtension.php
+6
-6
No files found.
src/Silex/Extension/FormExtension.php
View file @
cd4d3edb
...
@@ -17,15 +17,15 @@ use Symfony\Component\HttpFoundation\File\TemporaryStorage;
...
@@ -17,15 +17,15 @@ use Symfony\Component\HttpFoundation\File\TemporaryStorage;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider
;
use
Symfony\Component\Form\Extension\Csrf\CsrfProvider\DefaultCsrfProvider
;
use
Symfony\Component\Form\FormFactory
;
use
Symfony\Component\Form\FormFactory
;
use
Symfony\Component\Form\Extension\Core\CoreExtension
;
use
Symfony\Component\Form\Extension\Core\CoreExtension
;
use
Symfony\Component\Form\Extension\Validator\ValidatorExtension
;
use
Symfony\Component\Form\Extension\Validator\ValidatorExtension
as
FormValidatorExtension
;
use
Symfony\Component\Form\Extension\Csrf\CsrfExtension
;
use
Symfony\Component\Form\Extension\Csrf\CsrfExtension
;
class
FormExtension
implements
ExtensionInterface
class
FormExtension
implements
ExtensionInterface
{
{
public
function
register
(
Application
$app
)
public
function
register
(
Application
$app
)
{
{
$app
[
'form.
csrf_secret'
]
=
'12345'
;
$app
[
'form.
secret'
]
=
md5
(
__DIR__
)
;
$app
[
'form.
storage_secret'
]
=
'abcdef'
;
$app
[
'form.
tmp_dir'
]
=
sys_get_temp_dir
()
;
$app
[
'form.factory'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
$app
[
'form.factory'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
$extensions
=
array
(
$extensions
=
array
(
...
@@ -34,18 +34,18 @@ class FormExtension implements ExtensionInterface
...
@@ -34,18 +34,18 @@ class FormExtension implements ExtensionInterface
);
);
if
(
isset
(
$app
[
'validator'
]))
{
if
(
isset
(
$app
[
'validator'
]))
{
$extensions
[]
=
new
ValidatorExtension
(
$app
[
'validator'
]);
$extensions
[]
=
new
Form
ValidatorExtension
(
$app
[
'validator'
]);
}
}
return
new
FormFactory
(
$extensions
);
return
new
FormFactory
(
$extensions
);
});
});
$app
[
'form.csrf_provider'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
$app
[
'form.csrf_provider'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
return
new
DefaultCsrfProvider
(
$app
[
'form.
csrf_
secret'
]);
return
new
DefaultCsrfProvider
(
$app
[
'form.secret'
]);
});
});
$app
[
'form.storage'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
$app
[
'form.storage'
]
=
$app
->
share
(
function
()
use
(
$app
)
{
return
new
TemporaryStorage
(
$app
[
'form.s
torage_secret
'
]);
return
new
TemporaryStorage
(
$app
[
'form.s
ecret'
],
$app
[
'form.tmp_dir
'
]);
});
});
if
(
isset
(
$app
[
'form.class_path'
]))
{
if
(
isset
(
$app
[
'form.class_path'
]))
{
...
...
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