Yii v2 snippet guide III

Comparing #17 with #18

Revision #18 was created by rackycz rackycz on Jan 21, 2021, 2:50:24 PM.

Translations

Content

[...]
'<sys_lang:[a-z]{2}>/<controller:\w+>/<action:\w+>' => '<controller>/<action>',
],
],
],
```
Now the language-switching links will produce URL like this: http://myweb.com/en/site/index . Without the rules the link would look like this: http://myweb.com/site/index?sys_lang=en
 . So the rule works in both directions. When URL is parsed and controllers are called, but also when a new URL is created using the URL helper.