Skip to content

Commit

Permalink
Merge pull request #334 from LTaooo/5.x
Browse files Browse the repository at this point in the history
Update dependency-injection.md
  • Loading branch information
philipobenito authored Sep 27, 2024
2 parents b2d82a8 + 33e449c commit 369d39f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions docs/5.x/dependency-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ $container = new League\Container\Container;
$container->add(Acme\SomeController::class)->addArgument(Acme\TemplateRenderer::class);
$container->add(Acme\TemplateRenderer::class);

$strategy = (new League\Route\Strategy\ApplicationStrategy)->setContainer($container);
$router = (new League\Route\Router)->setStrategy($strategy);
$strategy = new League\Route\Strategy\ApplicationStrategy;
$strategy->setContainer($container);
$router = (new League\Route\Router)->setStrategy($strategy);

$router->map('GET', '/', Acme\SomeController::class);
~~~

0 comments on commit 369d39f

Please sign in to comment.