V
V
Vladislav Sofienko2017-10-17 00:45:35
Yii
Vladislav Sofienko, 2017-10-17 00:45:35

How to write a rule in urlManager that the url attribute can be anything except the word 'test'?

How to write a rule in urlManager that the url attribute can be anything except the word 'test'? As I understand it, this is how a regular expression is written. Don't tell me how?
'<url:\w+>' => 'page/view'

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Korobkov, 2017-10-17
@BorisKorobkov

In this case, you don't need to touch urlManager.
If there is no corresponding controller - and so it will be Not found.
If there is a controller, but you want limited access, then inside it check the necessary conditions and if something is wrong,throw new HttpException(404)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question