开发者

Zend Framework: Action controller naming rules

I am unclear on the naming rules for Actions using stadard routing, etc, in the Zend Framework. Am I limited to using lowercase letters only? And if so, how do other developers deal with the lack of flexibility?

The Standard Naming Conventions in the Zend Documentation (http://framework.zend.com/manual/en/coding-standard.naming-conventions.html) say that functions should be camelCased. There's no mention of any exception for Action functions.

Other sources (such as this cheatsheet http://www.ideveloper.de/weblog/zend-framework-cheat-sheet.pdf) agree with this, however camelCased Actions开发者_开发问答 don't work for me. The router converts the URL to lowercase before looking for the Action.

When the user requests createNewUser, Zend looks for the function createnewuserAction().

Any assistance appreciated!


CamelCase in the action names maps to hyphenation in the URL.

For example, a url like: /foo/some-thing maps to FooController::someThingAction()


You could name the controller FooController but I don't think FooFooController.

If I'm correct the Second word that begins with a capitalized letter has to be the word Controller.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜