Answer the question
In order to leave comments, you need to log in
Is it possible to inherit routings in Symfony?
Here are two abstract routings:
route_one:
pattern: /r1
defaults: { _controller: AcmeDemoBundle:Main:index, param1:1, param2:2, param3:3, param4:4}
route_two:
pattern: /r2
defaults: { _controller: AcmeDemoBundle:Main:index, param1:1, param2:2, param3:3, param4:5}
Answer the question
In order to leave comments, you need to log in
You can use shared variables in php configs.
You can also try to separate similar routes into a separate class in annotations and set general parameters in class annotations, and define specific ones through method annotations.
Edit: For xml and yml one can try subcollections:
main.yml
_sub:
resource: "@AcmeDemoBundle/Resources/config/sub.yml"
prefix: /
defaults: { _controller: AcmeDemoBundle:Main:index, param1:1, param2:2, param3:3 }
route_one:
pattern: /r1
defaults: { param4:4 }
route_two:
pattern: /r2
defaults: { param4:5 }
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question