mirror of
https://gitnet.fr/deblan/gist.git
synced 2021-08-14 08:30:49 +02:00
default locale
This commit is contained in:
parent
ca4246d3af
commit
a68da97952
@ -63,8 +63,12 @@ $app->get('/', function (Request $request) use ($app) {
|
||||
));
|
||||
});
|
||||
|
||||
$app->after(function(Request $request, Response $response) use ($app) {
|
||||
$value = $request->cookies->get('locale');
|
||||
$app->after(function (Request $request, Response $response) use ($app) {
|
||||
if ($response instanceof RedirectResponse) {
|
||||
return;
|
||||
}
|
||||
|
||||
$value = $request->get('_locale');
|
||||
|
||||
$cookie = new Cookie('locale', $value, strtotime('+1 month'));
|
||||
$response->headers->setCookie($cookie);
|
||||
|
Loading…
Reference in New Issue
Block a user