|--------------------------------------------------------------------------
| Enable Query Strings
|--------------------------------------------------------------------------
|
| By default CodeIgniter uses search-engine friendly segment based URLs:
| www.your-site.com/who/what/where/
|
| You can optionally enable standard query string based URLs:
| www.your-site.com?who=me&what=something&where=here
|
| Options are: TRUE or FALSE (boolean)
|
| The two other items let you set the query string "words" that will
| invoke your controllers and its functions:
| www.your-site.com/index.php?c=controller&m=function
|
| Please note that some of the helpers won't work as expected when
| this feature is enabled, since CodeIgniter is designed primarily to
| use segment based URLs.
|
*/
$config['enable_query_strings'] = FALSE;
$config['controller_trigger'] = 'c';
$config['function_trigger'] = 'm';
在 config.php 里设置,$config['enable_query_strings'] = TRUE; 就可以使用 URL 参数了,下面两个选项是控制器用c=xxxx,控制器方法用m=xxxx,上面的注释说的也很清楚。 恩。。觉得两种url传参数的方式都不错。。。。:) 建议还是适用分段传递参数的方法,这样更好,适合SEO的胃口。 谢谢分享,收到了,继续加油 得考虑以后的REST。 嘿嘿 不错哦 :lol 跟JAVA的MVC实现起来还是挺像的,呵呵~ 对CI的事务机制的实现更感觉兴趣,有空一定会看一下:loveliness: