dssk35460 2011-04-15 14:09
浏览 37
已采纳

如何使Kohana的路由更像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?

  • 写回答

1条回答 默认 最新

  • dshakcsq64956 2011-04-15 14:15
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥30 BC260Y用MQTT向阿里云发布主题消息一直错误
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏
  • ¥15 划分vlan后,链路不通了?
  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)