According to http://www.slimframework.com/docs/tutorial/first-app.html, the slim object is first created, and then the container is gotten and services are added to it.
$app = new \Slim\App(["settings" => $config]);
$container = $app->getContainer();
$container['logger'] = function($c) {
...
return $logger;
};
However, http://www.slimframework.com/docs/concepts/di.html which is specifically about the dependency container is much stronger and states:
You don’t have to provide a dependency container. If you do, however, you must inject the container instance into the Slim application’s constructor.
$container = new \Slim\Container; $app = new \Slim\App($container);
Is one way more proper than the other?
How are services added when using the second approach?