H
H
hdworker2015-04-23 15:17:02
Nginx
hdworker, 2015-04-23 15:17:02

Yii2 distinguishes case-sensetive controller name?

Hello gentlemen!
Tell me, has anyone seen the Yii2 behavior when uppercase and lowercase letters are distinguished in the name of the controller from the URL?
I did a fresh install of Yii2, I pass in the url ?r=PlGeoObject/ -- 404 error.
Renamed PlGeoObjectController to ObjectController - everything worked.
Can you please tell me what is this setting?
Thank you in advance,

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
bzz, 2015-04-23
@hdworker

must pass ?r=pl-geo-object/

N
Nazar Mokrinsky, 2015-04-23
@nazarpc

Actually, in the *nix world, case matters.
That is, if your file with the controller has one register, and you are looking for another, the class autoloader will simply not find it, while it should work in Windows (although it also depends on the situation, it may not work).

O
OnYourLips, 2015-04-23
@OnYourLips

Everything is very simple, but you are confusing the effect and the cause.
- The class name is case-insensitive.
- The class name must match the file name.
- The file name is case sensitive.
Draw a conclusion from these three judgments.
If you use a class name in a different case, then the autoloader cannot find a file with this class, and an error occurs.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question