xuyaokun 发表于 2014-10-22 23:26:52

routes.php 里怎么一句话去掉welcome ?


$route['stores'] = 'welcome/stores';
$route['stores_detail_(:num)'] = 'welcome/stores_detail/$1';
$route['events'] = 'welcome/events';
$route['events_old'] = 'welcome/events_old';
$route['recruiting'] = 'welcome/recruiting';
$route['contact_us'] = 'welcome/contact_us';
$route['online/(:any)/(:num)'] = 'welcome/online/$1/$2';



以上是我写的。但是随着页面增多,发现都要写一下“ welcome ” 去掉。问下高手们有啥办法一句搞定的,直接不要啊。

Closer 发表于 2014-10-27 10:04:24

xuyaokun 发表于 2014-10-25 10:18
这样不行啊。ls
我試著可以啊,你再試試吧。

要呼叫你這個 events 方法
$route['events'] = 'welcome/events';
用了阿呆的方式:$route['(:any)'] = 'welcome/$1';

只要打 http://localhost/index.php/events 就行了阿

xuyaokun 发表于 2014-10-25 10:18:11

这样不行啊。ls

阿呆 发表于 2014-10-24 09:55:52

这样?$route['(:any)'] = 'welcome/$1';
页: [1]
查看完整版本: routes.php 里怎么一句话去掉welcome ?