Open felixWackernagel opened 4 years ago
I'd try
$klein->respond( function ( $request, $response, $service, $app ) {
$app->register('context', function() use ($request) {
// Lazy init
return [
'pageTitle' => 'Demo Site',
'locale' => $request->locale
];
});
});
Each of my routes start with the locale.
For rendering i used twig and all information for twig is stored inside a service array called context.
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.