add DI Container to app instance
This commit is contained in:
parent
f4eed80d4d
commit
44325cd74c
1 changed files with 6 additions and 1 deletions
|
|
@ -1,12 +1,17 @@
|
|||
<?php
|
||||
|
||||
use DI\Container;
|
||||
use Psr\Http\Message\ResponseInterface as Response;
|
||||
use Psr\Http\Message\RequestInterface as Request;
|
||||
use Slim\Factory\AppFactory;
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
$app = AppFactory::create();
|
||||
$container = new Container();
|
||||
|
||||
$app = AppFactory::createFromContainer($container);
|
||||
|
||||
$app->addErrorMiddleware(true, false, false);
|
||||
|
||||
$app->get('/', function (Request $request, Response $response, $args) {
|
||||
$response->getBody()->write("Hello world!");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue