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
d8b0d797
Commit
d8b0d797
authored
Jun 13, 2012
by
Christophe Coevoet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added the LocaleListener to handle setting the locale
parent
1e5452b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/Silex/Application.php
src/Silex/Application.php
+2
-1
No files found.
src/Silex/Application.php
View file @
d8b0d797
...
...
@@ -21,6 +21,7 @@ use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
use
Symfony\Component\HttpKernel\Event\FilterResponseEvent
;
use
Symfony\Component\HttpKernel\Event\GetResponseEvent
;
use
Symfony\Component\HttpKernel\Event\PostResponseEvent
;
use
Symfony\Component\HttpKernel\EventListener\LocaleListener
;
use
Symfony\Component\HttpKernel\EventListener\ResponseListener
;
use
Symfony\Component\HttpKernel\EventListener\RouterListener
;
use
Symfony\Component\HttpKernel\Exception\HttpExceptionInterface
;
...
...
@@ -85,6 +86,7 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
return
$app
[
'url_matcher'
];
});
$dispatcher
->
addSubscriber
(
new
RouterListener
(
$urlMatcher
,
$app
[
'logger'
]));
$dispatcher
->
addSubscriber
(
new
LocaleListener
(
$app
[
'request.default_locale'
],
$urlMatcher
));
return
$dispatcher
;
});
...
...
@@ -469,7 +471,6 @@ class Application extends \Pimple implements HttpKernelInterface, EventSubscribe
$current
=
HttpKernelInterface
::
SUB_REQUEST
===
$type
?
$this
[
'request'
]
:
$this
[
'request_error'
];
$this
[
'request'
]
=
$request
;
$this
[
'request'
]
->
setDefaultLocale
(
$this
[
'request.default_locale'
]);
$this
->
flush
();
...
...
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