开发者

controller class naming convention conflict (php)

I am building an MVC framework. I am using the PEAR naming convention. Classes have the first letter of each word capitolized.

The problem is when I get to the controller classes. The framework loads the controller based on the URL path. I do not however want to need uppercase letters in my URLs. Is ther开发者_Python百科e a common way to deal with this problem?


Just fetch the name of the controller from the url (e.g. /controller/action/id) and use ucfirst() to get the class name of your controller. That's the common way to do it.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜