I’m trying to access the environment in Slim 3.
Specifically I’m trying to set some environment variables within my Middleware Class.
Is there a way to access the Slim instance in Slim 3 like there was in Slim 2?
For example in Slim 2 you could do something like:
$app = \Slim\Slim::getInstance();
From there you could grab the environment:
$env = $app->environment();
And then adjust environment variables accordingly:
$env['user'] = $user;
Then later use this middleware pre-set environment variable in any route.