Svish
Svish

Reputation: 158331

How to allow hyphens in controller and action names in Kohana 3

I would like to use hyphens in my URLs, but since controllers are classes and actions are methods, they of course cannot have hyphens in them. I think for example that about-us looks a lot better in a URL than about_usor aboutus.

Is there a good and clean way to make this happen in Kohana 3.2?

Note: I've seen how you can do this with action parameters, and for that you can just make a route with regex allowing those. But I'm talking about controller and action names here.

Upvotes: 1

Views: 454

Answers (1)

Darsstar
Darsstar

Reputation: 1895

You could use a lambda route or overload the Request::controller() and Request::action() methods.

Upvotes: 2

Related Questions