Skip to content

Conversation

@akrabat
Copy link
Member

@akrabat akrabat commented May 7, 2018

Create a Uri object rather than a string and also show usage of PSR-11
method to retrieve from container.

Closes #92

Create a `Uri` object rather than a string and also show usage of PSR-11
method to retrieve from container.

Closes #92
$basePath = rtrim(str_ireplace('index.php', '', $c['request']->getUri()->getBasePath()), '/');
$view->addExtension(new \Slim\Views\TwigExtension($c['router'], $basePath));
$router = $c->get('router');
$uri = Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER)):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the environment already registered in the container?

Copy link
Member Author

@akrabat akrabat May 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to discourage use of environment, request or response in the container as they won't be there in 4.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note - there is a colon and not a semicolon at the end of line 34 in the readme file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh noes!

Copy link
Member Author

@akrabat akrabat May 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! Fixed & pushed.

@akrabat akrabat merged commit e4e0486 into slimphp:master May 7, 2018
akrabat added a commit that referenced this pull request May 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants