So, I realize that this has been discussed before in #20 and also in slimphp/Slim#1326, but it seem this has not really been resolved.
Let me explain the problem again
- Sometimes I need a fully qualified URL to a named route. Simplest example: I'm using twig to build the email body for an account activation mail. Let's say I have a route named
activate with a parameter token
- My application runs in a sub directory of the web server. Let's say
/app
So here are my options:
{{ path_for('activation', {token: 'foo'}) }} -> /app/activation/foo
{{ base_url() }} -> http://example.com/app
As you can see, I can not simply combine the two to create an absolute URL, since the initial directory would be duplicated. Ideally I would have a url_for() method that works exactly like path_for but returns a fully qualified URL.
So, I realize that this has been discussed before in #20 and also in slimphp/Slim#1326, but it seem this has not really been resolved.
Let me explain the problem again
activatewith a parametertoken/appSo here are my options:
{{ path_for('activation', {token: 'foo'}) }}->/app/activation/foo{{ base_url() }}->http://example.com/appAs you can see, I can not simply combine the two to create an absolute URL, since the initial directory would be duplicated. Ideally I would have a
url_for()method that works exactly likepath_forbut returns a fully qualified URL.