Answer the question
In order to leave comments, you need to log in
What is the correct way to merge routing rules in Symfony2?
There are two rules:
records:
path: /records
defaults: { _controller: SomeBundle:Index:index, page: 1 }
records_page:
path: /records/page/{page}
defaults: { _controller: SomeBundle:Index:index }
requirements:
page: \d+
records:
path: /records(/page/{page})?
defaults: { _controller: SomeBundle:Index:index, page: 1 }
requirements:
page: \d+
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question