degoogle 发表于 2008-8-20 10:41:25

请教高人

视频上的例子中的数据库类
$this->db->where('entry_id',$this->uri->segment(3));
这段是什么意思啊,我总是看不懂,

还有,在view页面中创建一个hidden,它的value怎么动态生成的,就像这样:<form action="http://127.0.0.1/CodeIgniter/index.php/blog/comment_insert" method="post"><input type="hidden" name="entry_id" value="2" />

代码是这样的
<?php echo form_hidden('entry_id',$this->uri->segment(3));?>

$this->uri->segment(3))不是url分段吗,得到的值应该总是3啊,

[ 本帖最后由 degoogle 于 2008-8-20 10:42 编辑 ]

le_el 发表于 2008-8-20 16:12:45

$this->uri->segment(3)) 截取第3段的参数.得到值不固定.

Hex 发表于 2008-8-20 17:39:00

是的,是取第三段的内容,比如 index.php/控制器/方法1/方法2
得到的是 方法2
页: [1]
查看完整版本: 请教高人