开发者

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

开发者 https://www.devze.com 2023-01-03 13:33 出处:网络
I\'ve created a Zend_Application using the zf tool that\'s bundled with Zend Framework (1.96, if that matters)

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 charact开发者_如何学编程ers get treated differently, and I'd like to know the base rules I'm dealing with.


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.

0

精彩评论

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