用户
 找回密码
 入住 CI 中国社区
搜索
查看: 3281|回复: 2
收起左侧

请教高人

[复制链接]
发表于 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 编辑 ]
发表于 2008-8-20 16:12:45 | 显示全部楼层
$this->uri->segment(3)) 截取第3段的参数.得到值不固定.
发表于 2008-8-20 17:39:00 | 显示全部楼层
是的,是取第三段的内容,比如 index.php/控制器/方法1/方法2
得到的是 方法2

本版积分规则