-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need a fully qualified urlFor() helper #1326
Comments
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.
The text was updated successfully, but these errors were encountered: