2008年8月20日星期三

[fw-mvc] Action controller: view rendering when action name in url is capitalized

I'm encountering some strange behaviour when simulating a typo error
(capitalization) in an url.
In the example I have defined an account controller with a login action.

* case 1
http://foo.bar/account
http://foo.bar/accounT

view render OK -> scripts/account/index.phtml

* case 2
http://foo.bar/account/login
http://foo.bar/account/LOGIN

view render OK -> scripts/account/login.phtml

* case 3
http://foo.bar/account/logiN
http://botra.dev/account/LOGIn

Fatal error: Uncaught exception 'Zend_View_Exception' with message
'script 'account/log-in.phtml' not found in path

How to avoid case 3?
I always want to render scripts/account/login.phtml.

--
S.

没有评论: