What/Where are the Naming Rules for Controller actions in a Zend_Application App

China☆狼群 提交于 2019-12-11 13:24:02

问题


I've created a Zend_Application using the zf tool that's bundled with Zend Framework (1.96, if that matters)

What at the rules for formatting action names and how those action names get translated into into URL paths, and where in the Framework codebase does this happen?

I ask because I tried to create an action like

public function createFooAction()
{
}

and it wouldn't load with a URL like

http://example.com/controller/createFoo

BUT, the following did work

public function createfooAction()
{
}
http://example.com/controller/createfoo

I also know non-alphanumeric characters get treated differently, and I'd like to know the base rules I'm dealing with.


回答1:


CamelCases are translated to dashes, so createFooAction would be available as http://example.com/controller/create-foo. You can use the Zend Router to add/change URL to Action mapping.



来源:https://stackoverflow.com/questions/3056910/what-where-are-the-naming-rules-for-controller-actions-in-a-zend-application-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!