Closed akrabat closed 9 years ago
Related question -- Are we going to rename url_for() in Twig-View to match what we named it here? Being I guess path_for() for consistency? Deprecate url_for() and I guess create a uri_for() or similar so that names are aligned with functionality and maintain a level of consistency.
Based on IRC chat:
Another option would be to add a method to the Request that returns the combination of scheme, domain, port and base path. It could be used something like this:
$url = $app->request->siteUrl($app->router->pathFor('hello'));
or
$url = $app->request->siteUrl() . ltrim($app->router->pathFor('hello'), '/');
How about something like #1328 to provide an easy way to get the fully qualified URL including the base path?
This would be nice. I always run into the need for this when sending emails that need to provided a full URI so folks can click to access the application.
This have now been merged in.
In the current Slim 3, to create a fully qualified URL for a given route name, you need to do this inside a route callable:
We need a helper method for this.