Zend Framework: Using Dashes in Controller Names/U

2019-03-29 10:54发布

问题:

I have a URL I would like to look something like http://server/my/action-name

Obviously, I can't have a - in the ControllerName function and an underscore doesn't work. Is this even possible?

回答1:

By default

http://server/my/action-name

will map to

MyController::actionNameAction()

but you can also setup arbitrary routes with the Standard Router.



回答2:

use camel casing. It works for actions:

function actionNameAction()