-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Routing] add support for optional placeholders in the host #7306
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
Comments
This would be perfect for what I need as well. Without it I'm going to have to double the amount of routes I already have. |
+1 |
The problem with using an extra route is that it messes with url generators. Take the following routes:
If I visit I suppose it depends on how your project works, but I'd greatly appreciate optional routes. |
@Tobion maybe a better implementation would be to also allow multiple options in the host (as an array)? I'll try to make a PR next week. |
@xmarcos what you mean? the params in the host can be any regex, so you can already have multiple matches |
I mean multiple hosts not multiple patterns in the same host. In the example above
Instead of making homepage:
pattern: /
host: ["{site}.site.com", "admin.{site}.site.com", "site.com", "site.dev"] |
this doesnt really work because the generator wouldnt know which host to generate. also you could have potentially different params in there which wouldnt work either |
+1 |
2 similar comments
+1 |
+1 |
jap, +1 |
+1 |
8 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
Anyone willing to submit an implementation? |
Actually there was one which has been closed unreviewed: #10254 |
Closing as I haven't had the need for this yet. If someone else needs the feature, feel free to create a PR. |
Optional placeholders are not implemented yet for the host (unlike the path).
So given
{subdomain}.domain.com
it cannot matchdomain.com
because the dot is statically required.Ref. #6821
The text was updated successfully, but these errors were encountered: