我正在尝试从 url 中捕获斜线并将它们传递到我的控制器中。这是我的问题的一个例子:
假设我 GEThttp://localhost/here/is/an/example我的路线如下所示:
$routes['here/is/(:any)'] = 'my_controller/$1';
我有以下函数定义my_controller:
public function index($rest_of_the_path) {
...
}
我希望$rest_of_the_pathto 的值是'an/example',但它实际上等于'an'。如何构建我的代码以便得到我想要的?
PS:我正在使用 Codeigniter 2.1.3