In the rules, urlManager prescribed:
'<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>', '<controller:\w+>/<action:\w+>/<id:\d+>/<name:\w+>' => '<controller>/<action>', I generate URL:
$this->createUrl('article/tag', ['id' => $model->id, 'name' => $model->name]); //$model->id=1; $model->name='newname' I expect the following URL: http://domain.ru/article/tag/1/newname
But I get this: http://domain.ru/article/tag/1/?name=newname
It seems that the second rule is simply not involved.
I tried to remove the first rule, and the URL was formed as it should, but on pages with a URL without the name parameter (for example http://domain.ru/article/tag/1 ), if I want to get access to $_GET['id'] error crashes. Undefined index: id . In short, links only work when there are 2 parameters.