I have a service that I want to access from a route but pass arguments to.
$container = new \Slim\Container();
$container['myService'] = function($arg1, $arg2) {
//my code here
};
$app = new \Slim\App($container);
and inside my route, I try to call the service like so:
$this->myService('my arg1', 'my arg2');
This is not working. When I try to call it without specifying the arguments, it works.
How to call with arguments? Or is that an alternative way to specify a function or method to be called from inside a route?