Answer the question
In order to leave comments, you need to log in
Why does Slim practice such work with containers (with an example)?
For example, put the controller in a container
$container['UserController'] = function($container) {
return new App\Controllers\UserController($container);
};
$app->get('/', 'UserController:listUsers');
$app->get('/', 'App\Controllers\UserController:listUsers');
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question