Search code examples
urlrouteskohana-3

Kohana 3.1 - how to name controller with dash (-)


I'm working with Kohana 3.1 and this is my problem:

I want to make controller that is named like this: Controller_my-controller so I can have URL like this http://example.org/my-controller

How can I do something like this? Some routing or maybe some type of class that changes naming?


Solution

  • Its not possible as Kohana Controller is a PHP class and you need to follow PHP class naming conventions. But you can write a Route with function that can remove (-) from controller name before Kohana will search for mycontroller not my-controller. documentation