Skip to content

Commit 6a0b2a1

Browse files
committed
Merge branch 'update-README-example'
Closes #98 Fixes #92
2 parents 78386c0 + e4e0486 commit 6a0b2a1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ $container['view'] = function ($c) {
3030
]);
3131

3232
// Instantiate and add Slim specific extension
33-
$basePath = rtrim(str_ireplace('index.php', '', $c['request']->getUri()->getBasePath()), '/');
34-
$view->addExtension(new \Slim\Views\TwigExtension($c['router'], $basePath));
33+
$router = $c->get('router');
34+
$uri = Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER)):
35+
$view->addExtension(new \Slim\Views\TwigExtension($router, $uri));
3536

3637
return $view;
3738
};

0 commit comments

Comments
 (0)