Answer the question
In order to leave comments, you need to log in
Why does Yii2 generate invalid named URls?
Subject. Has Url rules
'rules' => [
'room/<room_id:\d+>/calendar' => 'calendar/view',
'room/<room_id:\d+>/calendar/<month:\d+>/<year:\d+>' => 'calendar/view',
],
Url::to(['calendar/view', 'room_id' => $this->room_id, 'month' => $month, 'year' => $year]);
/room/1/calendar?month=06&year=2017
Answer the question
In order to leave comments, you need to log in
Because 1 rule works, not the second. You should leave 1 or try to change their order
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question