kohana 像在 codeigniter 中一样获取参数
搜索这个问题,我发现了这个问题/答案: Kohana 3 获取当前控制器/action/arguments
我最近切换到 Kohana使用 codeigniter 一段时间后。 在 Codeigniter 中,您可以(在控制器中)执行以下操作:
public function action_nameAction($param1, $param2 = null, ...){
$something = $param1;
}
通过调用 www.mysite.com/controllerName/param1/param2
我真的很喜欢这种方法,并且不太理解 Kohana 重新定义路线的方法的要点...
如果Kohana 中有一个使用 Codeigniter 方法的解决方案,我想要一些关于如何实现它的线索。 如果没有,请有人向我解释一下必须为不属于默认路由的每种情况重新定义新路由的好处......
searching for this question, I found this question/answer:
Kohana 3 get current controller/action/arguments
I recently switched to Kohana after using codeigniter for a while.
In Codeigniter, you could just do (in a Controller):
public function action_nameAction($param1, $param2 = null, ...){
$something = $param1;
}
by calling www.mysite.com/controllerName/param1/param2
I really liked this approach and don't really understand the point of Kohana's approach with redefining the routes...
If there is a solution to have the Codeigniter approach in Kohana, I would like some clues on how to implement it.
If not, please could someone explain me the interest of having to redefine new routes for every case that doesnt fall into the default route...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)