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

ci 获取参数

[复制链接]
发表于 2012-8-30 12:42:57 | 显示全部楼层 |阅读模式
直接输入路径
http://localhost/ci/index.php/welcome/index/a/99
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Welcome extends CI_Controller {
        public function index()
        {
        var_dump($_REQUEST);
                $this->load->view('welcome_message');
        }
}

无法取到参数 什么问题?
 楼主| 发表于 2012-8-30 12:46:13 | 显示全部楼层
http://localhost/ci/index.php/welcome/index?a=99
这样就可以获得参数
发表于 2012-8-30 14:30:39 | 显示全部楼层
发表于 2012-8-31 10:46:58 | 显示全部楼层
你的 URL 是要通过 $this->uri->segment(URL段) 来获取参数
发表于 2012-8-31 12:38:07 | 显示全部楼层
这样能获取到吗??
发表于 2012-9-1 09:27:06 | 显示全部楼层
看来你得先看看uri的规则了。

本版积分规则