I'm trying to create custom functions with parameters within my container but everything I do ends up failing. My current code is as folllows:
$container['myFunction'] = function($container) {
return function($arg) {
return $arg;
};
};
// Called from a route:
echo $this->myFunction("test"); // Call to undefined method Slim\Container::myFunction()
Am I doing something wrong? From what I read online this should be the correct way to define a custom container functions with Slim 3. Any help would be great, thanks!