Skip to content

Allow override of default host at controller level #58477

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

Closed
Yolo-plop opened this issue Oct 7, 2024 · 7 comments
Closed

Allow override of default host at controller level #58477

Yolo-plop opened this issue Oct 7, 2024 · 7 comments

Comments

@Yolo-plop
Copy link

Description

Hello,

I've been asked that two pages of a website manage use a specific domain. I thought naively that it would be as simple as adding a default host in config/routes/annotations.yaml and override them in the specific controllers that need to use a different host but it's not the case. The host at controller level is simply ignored. I could have created some kind of custom route loader to manage that, which seems pretty overkill for a simple content website, so I had to specify the domain for every controller. Besides this being annoying, it means me and my coworkers will have to remember to specify the domain every time a new controller is added.

It would be nice if it was possible to simply override the host (or other parameters) of a route when they have been defined in the global config. This in my opinion would be the logical expected behavior.

Example

No response

@stof
Copy link
Member

stof commented Oct 7, 2024

Defining settings on a route import is not about setting default values. It is about overriding the imported value. That's why your host on the specific controller does not work: it gets overridden by the host set when importing routes.

@Yolo-plop
Copy link
Author

Ok, but is there a way to set a default value then? I couldn't find one.

@stof
Copy link
Member

stof commented Oct 7, 2024

no, we don't have a way to set default values right now (except a custom loader that would instantiate the Route object with different settings)

@Yolo-plop
Copy link
Author

Ok, well I think that would be a useful feature to have, it don't believe the use case is that rare.

@javiereguiluz javiereguiluz changed the title Allow orride of default host at controller level Allow override of default host at controller level Oct 12, 2024
@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?
Every feature is developed by the community.
Perhaps someone would like to try?
You can read how to contribute to get started.

@carsonbot
Copy link

Could I get a reply or should I close this?

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

@carsonbot carsonbot closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants