I try to set the following Route with Kohana 3.2:
api/<version>(/<controller>(/<action>(/<id>)))(.<format>)
and want to put the controller in an directory inside the controller folder with the name of the <version> param. But how can I name the Class so that Kohana find my Controller?
e.g. :
I open the url api/1.0/hello/say and want to load the controller inside the folder classes/controller/1.0/hello.php but as the convention says I need to name the controller like Controller_1.0_Hello… But as far as I know, php doesn’t allow numbers and points on classnames..
How can I solve this?
You can map the route explicitly to any controller/method you want. I wrote a tutorial that might help you out: http://www.kineticklink.com/kohana-3-routing/
Basically, you can’t have a period in a className, but you can have a number.