Hex 发表于 2007-11-12 09:43:59

/*
|--------------------------------------------------------------------------
| 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,上面的注释说的也很清楚。

sam 发表于 2007-12-15 09:14:04

恩。。觉得两种url传参数的方式都不错。。。。:)

特蓝克斯 发表于 2008-3-7 09:16:52

建议还是适用分段传递参数的方法,这样更好,适合SEO的胃口。

xhq6632 发表于 2008-3-24 10:14:32

谢谢分享,收到了,继续加油

fumaoyue 发表于 2008-4-12 15:09:08

得考虑以后的REST。

wnpers 发表于 2008-5-13 10:40:32

嘿嘿 不错哦                  :lol

NightCreator 发表于 2008-5-28 21:39:47

跟JAVA的MVC实现起来还是挺像的,呵呵~

NightCreator 发表于 2008-5-28 21:42:22

对CI的事务机制的实现更感觉兴趣,有空一定会看一下:loveliness:

jerry051 发表于 2008-6-11 22:02:46

总数怎么能用$id啊?

既然数据是存放在数据库中,总会有GRUD的操作吧?从中间删掉几条记录,你取的$id还能是总数吗?

webyjh 发表于 2008-7-15 15:14:37

感谢hex提供这么详细的教程
页: 1 [2] 3 4 5 6 7 8
查看完整版本: CodeIgniter 的基本架构