Closed milpas999 closed 5 years ago
that is not how you construct a container; that is how you define a service in the container.
try
$container['dbMeedo'] = function($c) {
$arrDriverDetails = $c['settings']['dbMeedo'];
$MedooDb = new Medoo($arrDriverDetails);
return $MedooDb;
};
Are you doing $container = $app->getContainer()
before using $container
?
$container = $app->getContainer();
$container['renderer'] = function ($c) {
$settings = $c->get('settings')['renderer'];
return new Slim\Views\PhpRenderer($settings['template_path']);
};
@milpas999 Have you resolved your issue?
This issue is stale. Closing.
I am trying to create a service for the database connection. I have used the same steps as given in the slim 3 and pimple DI documentation. But Container is not getting created.