【发布时间】:2013-01-31 21:42:57
【问题描述】:
我正在尝试从 url 中捕获斜杠并将它们传递到我的控制器中。这是我的问题的一个例子:
假设我 GET http://localhost/here/is/an/example 我的路线如下所示:
$routes['here/is/(:any)'] = 'my_controller/$1';
我在my_controller 中有以下函数定义:
public function index($rest_of_the_path) {
...
}
我希望$rest_of_the_path 的值为'an/example',但它实际上等于'an'。如何构造我的代码以便得到我想要的?
P.S.:我使用的是 Codeigniter 2.1.3
【问题讨论】:
标签: php codeigniter routing routes