I’m trying to figure out if I can create a custom $request
object in Slim 3, with some of my own custom methods. I saw https://github.com/slimphp/Slim/issues/1480 through which I wrote:
'settings' => [
'request' => function ($c) {
return \App\Request::createFromEnvironment($c['environment']);
},
]
$app = new \Slim\App($settings);
Then in my routes:
$app->get('/systems', '\App\Controllers\SystemsController:index');
But in my controller method, my $request
object doesn’t have any of the methods in my extended function. Not sure what I’m misunderstanding.