Hello.
I have a rule in the framework:
... 'urlManager' => [ 'enablePrettyUrl' => true, 'enableStrictParsing' => true, 'showScriptName' => false, //'suffix' => '.html', 'rules' => [ '' => 'site/index', '<action:apple>.asp' => 'site/apple', // этот преффикс работает '<action>' => 'site/<action>', [ 'pattern' => 'posts', 'route' => 'site/posts', 'suffix' => '.json', ], // этот преффикс не работает (взято из документации) ], ], ... It is possible to output letters or numbers to the CNC.
Example '/post/<link:\w+>' => 'site/post', // выведет GET-параметр в виде текста
Example '/post/<link:\d+>' => 'site/post', // выведет GET-параметр в виде цифр
There are more special characters: ~% $ @!
They sometimes have to be used as a protection against hacking, for example, there is some other password that is not meant for logging into the site, but for allowing you to perform some actions, and of course it would be better if such passwords are with special characters, then it is difficult to choose password, and frequent selection attempts can be banned in such cases.
The question is as follows:
How to write a rule correctly so that you can display both numbers, letters, and special characters, and even with the prefix that users need to know in order to correctly enter. (prefix can be anything)
As shown in the rules above, the prefix for a specific page can be added by referring to a specific action, otherwise Achtung.
I don’t remember how to write the rule for numbers and letters together, and I don’t even know how to make 3 types of characters, the information is separate in the documentation.
Who made the combined rule? Show how it looks.
You are welcome :)