Reputation: 3650
I'm using the Zend Framework 1.12 in a project.
Something is so weird. I haven't use the Module. Just the Controller and Action.
My Controller file name is MyCCController.php
, 'CC' is upper case.
My action in this controller file is MyAAAction
,'AA' is upper case.
I tried the url http://localhost:8003/Mycc/myAA
. It shows the error-'Page not found'.
I googled and see some one said action name must be lower case. So I change the 'MyAAAction' to 'myaaAction'. And the .phtml file is sitll 'views\scripts\MyCC\MyAA.phtml'. It doesn't care about the uppercase or lowercase.
Then I visited the url http://localhost:8003/MyCC/myaa
, It still shows 'Page not found'.
I changed the url http://localhost:8003/Mycc/myaa
, 'CC' became 'cc'.Then It's OK.
So my question is that is there any article elaborating the MVC URL case sensitive rules?
Or who can give me the rule about the name of controller,action,*.phtml file or something relative.
And if I need the action Name as camelCase, how to realize it?
Upvotes: 1
Views: 907
Reputation: 3503
Actually if you had read the Zend Framework 1.12 manual (at the end of page there is a "Case Naming Conventions" section) you can find this:
If you wish to have your controller class or action method name have multiple MixedCasedWords or camelCasedWords, you will need to separate those words on the url with either a '-' or '.' (though you can configure the character used).
So this is correct url call for your controller and action: http://localhost:8003/my-c-c/my-a-a
Also, when using (auto rendering) view scripts for that action it should be located and named as this /views/scripts/my-c-c/my-a-a.phtml
Upvotes: 5