Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么正则表达式不能在CodeIgniter中传递参数?_Codeigniter_Codeigniter Url - Fatal编程技术网

为什么正则表达式不能在CodeIgniter中传递参数?

为什么正则表达式不能在CodeIgniter中传递参数?,codeigniter,codeigniter-url,Codeigniter,Codeigniter Url,当我查看编辑器控制器时,在index方法中,我没有传递参数。它只是说$1您可以尝试$route[':any']=编辑器 然后根据需要处理: $route['[0-9A-Za-z]'] = "editor/index/$1"; function index() { $id = $this->uri->segment( 3 ); // Or whatever segment you end up with. // Do something. }

当我查看编辑器控制器时,在index方法中,我没有传递参数。它只是说$1

您可以尝试$route[':any']=编辑器

然后根据需要处理:

$route['[0-9A-Za-z]'] = "editor/index/$1";
function index() {
    $id = $this->uri->segment( 3 ); // Or whatever segment you end up with.

    // Do something.
}