I have a problem with Yii2's urlManager. I have an action with url category/index
, where I pass ?par=test
as param.
I want to create an alias for my url so that when par
is not specified the url will be /test
, but when it is specified the url should be /test/some-value
. Here is my config for now:
'rules' => [
[
'pattern' => 'test',
'route' => 'category/index',
],
'<subcats: (val|some-value)>' => 'test/<subcats>',