سؤال

Let's say I have a history portal and I got something like this in my router: article/{century}/{decade}/{year}/{month}/{day}
The problem is that my controller have boolean default values for all these variables (false), because the business logic should decide what to show without specifying a date.
How can I do this without specifying multiple routes for this?

هل كانت مفيدة؟

المحلول

 * @Route("article/{century}/{decade}/...", defaults={"century"="false", "decade"="false", ...})
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top