什么/在Zend_Application应用程序中控制器操作的命名规则在哪里 [英] What/Where are the Naming Rules for Controller actions in a Zend_Application App
问题描述
我使用与Zend Framework捆绑在一起的 zf
工具创建了一个 Zend_Application
)
I've created a Zend_Application
using the zf
tool that's bundled with Zend Framework (1.96, if that matters)
格式化操作名称的规则以及这些操作名称如何转换为URL路径,以及在Framework代码库中的哪些位置会发生什么?
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()
{
}
/ p>
and it wouldn't load with a URL like
http://example.com/controller/createFoo
但是,以下工作
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.
推荐答案
CamelCases已翻译为破折号,因此 createFooAction
将可用为 http://example.com/controller/create-foo
。您可以使用 Zend路由器添加/更改网址动作映射。
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.
这篇关于什么/在Zend_Application应用程序中控制器操作的命名规则在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!