Zend Framework: Using Dashes in Controller Names/URLs

与世无争的帅哥 提交于 2019-12-09 13:05:09

问题


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()


来源:https://stackoverflow.com/questions/3426036/zend-framework-using-dashes-in-controller-names-urls

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