duanpenpan5796 2019-03-22 04:45
浏览 75
已采纳

在CodeIgniter的Controller中的相同功能上设置多个路由

I have a situation where I have to get multiple parameters and these parameters are dynamic also by means user can enter 2 ,3 ,4 any number of parameters. I know if I have a static count of parameters then I can use (:any) in routes.

$route['function_name/(:any)/(:any)'] = 'Controller/function_name/$1/$2';

but this scenario is different.

  • 写回答

1条回答 默认 最新

  • dry18813 2019-03-22 05:03
    关注
    $route['function_name/(.+)'] = 'Controller/function_name/$1';
    

    With this you can pass multiple params within single route.

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

报告相同问题?