-
Notifications
You must be signed in to change notification settings - Fork 88
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
Alias and relative path problem #322
Comments
Alias
and relative path problem
Known problem here too 🖐 |
I don't use the <a href="{{ some_route | url }}">{{ @some_text }}</a> Maybe we could tweak the default |
@chaosflaws you wrote:
There's a long-running issue on this topic. |
I think this is a sensible solution. |
My f3 app is in a subdirectory of the server's document root. Therefore, I am using a <base ...> directive for relative URLs. Now I tried to use the alias filter to generate relative URLs from named routes:
<a href="{{ 'some_route' | alias }}">{{ @some_text }}</a>
The route looks somewhat like this:
$f3->route('GET @some_route: /some_path', 'Page\Start->display');
However, as the routes are prepended with a slash, the resulting URL is
/some_path
, which is an absolute path. Right now, I am using a custom filter to simply delete the leading slash, but maybe something built-in would come in handy?Just as a little side note, the syntax for chaining filters seemed unintuitive to me. I tried the obvious
| alias | my_filter
. Any reason filters are separated by commas?The text was updated successfully, but these errors were encountered: