-
Notifications
You must be signed in to change notification settings - Fork 289
Open
Description
Each of my routes start with the locale.
$klein->respond( '/', function ($request, $response, $service, $app) {
$response->redirect( '/en/' );
});
$klein->with('/[*:locale]', function () use ($klein) {
$klein->respond( 'GET', '/', [HomeController::class, 'get'] );
$klein->respond( 'GET', '/foo', [FooController::class, 'get']);
});For rendering i used twig and all information for twig is stored inside a service array called context.
$klein->respond( function ( $request, $response, $service, $app ) {
$app->context = [
'pageTitle' => 'Demo Site',
'locale' => $request->locale
];
});But at time of context initialization is locale null. When my callable of the respond-function is called only then is $request-locale available. I tried different approaches but everytime is locale not available.
Metadata
Metadata
Assignees
Labels
No labels