How to make Kohana's routing more like Zend Framework
Assuming this URL:
http://example.com/param1/value1/param2/value2
In the Zend Framework, by default I can easily retrieve the parameters of such as URL using $this->request->param("param1")
, $this->request->param("param2")
, etc.
However, in Kohana (3.1.2), by 开发者_开发知识库default there can be only one parameter (an ID) and everything else as to be manually setup in the bootstrap's routing.
So is there a way to make Kohana behave more like the Zend Framework? Perhaps is there some route I could set that will make it work like Zend?
If you need a variable number of parameters, you need to add overflow handler http://www.dealtaker.com/blog/2010/03/03/kohana-php-3-0-ko3-tutorial-part-6/
It will capture everything after provided parameters as a string. You just split it by slashes to get the rest of options.
精彩评论