[
'suffix' => '/',
['pattern' => '<page:\d+>', 'route' => 'site/index', 'defaults' => ['page' => 1]],
]
Then create a URL like that
Url::to(['site/index', 'page' => 1])
The generated URL should be
<a href="/">Home</a>
<a href="//">Home</a>
| Q | A
| ---------------- | ---
| Yii version | 2.0.11.2
| PHP version | 7.0.15
| Operating system | Centos 6
Issue is not reproducible on Yii 2.0.10
Probably will be fixed by https://github.com/yiisoft/yii2/pull/13624
Is there a typo in the issue description? The URL rule has a site/brand route and the URL creation example - site/index.
If we assume that the URL creation example should have a site/brand route then the expected result is incorrect since the non-optional parameter brand is omitted.
Sorry, for my typo in the description. I corrected it.
Confirmed via #13660.
The problem will be fixed by #13624
Added test to confirm it: https://github.com/yiisoft/yii2/pull/13624/commits/7206b2ba8a9e2a7648fa5507ce338fc851bc0a6e