CodeIgniter - When using $route['(:any)'] = 'pages/view/$1' how to use other controllers?

后端 未结 3 676
死守一世寂寞
死守一世寂寞 2020-12-12 02:30

When using

$route[\'(:any)\'] = \'pages/view/$1\';

and I want to use other controllers in my routing for example:

$route[\'del         


        
3条回答
  •  一整个雨季
    2020-12-12 02:56

    As indicated, $route['(:any)'] will match any URL, so place your other custom routes before the "catch-all" route:

    $route['del/(:any)'] = 'crud/del';
    // Other routes as needed...
    $route['(:any)'] = 'pages/view/$1';
    

提交回复
热议问题