如何在codeigniter中隐藏控制器名称

时间:2014-09-16 06:39:52

标签: codeigniter codeigniter-url

我有管理面板和另外一个前面板.....我有两个不同的控制器和我的routes.php我做了更改,但因为一些链接不起作用

$route['default_controller'] = "site";
$route['404_override'] = '';
$route['contact'] = 'site/contact';
$route['events'] = 'site/events'; 
$route['terms'] = 'site/terms';
$route['privacy'] = 'site/privacy';
$route['newevent'] = 'site/add_event';

$route['(:any)'] = "site/$1";
//$route['(:any)'] = "backos/$1";
$route['listevents'] = 'backos/events';
$route['listwhatsapp'] = 'backos/whatsapp';
$route['add_artist'] = 'backos/add_artist';
$route['add_club'] = 'backos/add_club';
$route['index'] = 'backos/index';
$route['check'] = 'backos/check';
$route['add_event'] = 'backos/add_event';
$route['add_city'] = 'backos/add_city';
$route['add_locality'] = 'backos/add_locality';
//$route['(:any)'] = "backos/$1";

这是我的routes.php文件。

1 个答案:

答案 0 :(得分:0)

试试这个......

$route['default_controller'] = "site";
$route['404_override'] = '';

$route['contact'] = 'site/contact';
$route['events'] = 'site/events'; 
$route['terms'] = 'site/terms';
$route['privacy'] = 'site/privacy';
$route['newevent'] = 'site/add_event';

$route['listevents'] = 'backos/events';
$route['listwhatsapp'] = 'backos/whatsapp';
$route['add_artist'] = 'backos/add_artist';
$route['add_club'] = 'backos/add_club';
$route['index'] = 'backos/index';
$route['check'] = 'backos/check';
$route['add_event'] = 'backos/add_event';
$route['add_city'] = 'backos/add_city';
$route['add_locality'] = 'backos/add_locality';

// this is a catch all if you don't put it as 
// the last one everything else below it wont work!
$route['(:any)'] = "site/$1";