Julian Tai
Julian Tai

Reputation: 43

How do I force Zend to use hyphens instead of camel case urls for two word controller names?

Zend allows me to use both

    http://localhost/controllerName
    http://localhost/controller-name

Instead I'd like to make all controllers use hyphens and redirect to this version

example:

    localhost/big-widget
    localhost/big-red-widget

I don't want to set them on an individual basis.

I couldn't find any useful tutorials on this, I'd appreciate any help!

I did look at http://framework.zend.com/manual/en/zend.controller.router.html and some other posts, but I didn't see anything that I could understand easily.

Thanks

Upvotes: 1

Views: 382

Answers (1)

ro ko
ro ko

Reputation: 2986

I think by default Zend Framework already uses hyphens instead of camel casing .

Example: If you have your controller class UserControlController then it automatically uses user-control for the URL and does the same for action userLoginAction uses user-login in URL. Like this

http://myapp.com/user-control/user-login/

Upvotes: 1

Related Questions