-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed as not planned
Description
Symfony version(s) affected
6.4.3
Description
Looking for a way to set the default hostname for routes, this SO answer should be correct, but as a comment notes, setting the host name in YAML clobbers any and all annotations parsed thereafter.
That is, YAML that defines an annotations/attributes resource must be parsed before the attributes:
# config/routes/routes.yaml
controllers:
resource:
path: ../../src
namespace: Foo\Bar
type: attribute
host: example.comSo it follows that logically that which is parsed later should override that which is declared earlier.
#[Route(host: 'example.org')]
final class Foo extends AbstractController {}Yet it does not: setting the host in YAML clobbers all Route() attributes. Thus it appears impossible to set a default host since we are not in control of this parse order.
How to reproduce
See above.
Possible Solution
No response
Additional Context
No response