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

[HELP] 新手请教ci问题~第一次学习ci,还望大侠们多多指教

[复制链接]
发表于 2011-4-18 13:56:11 | 显示全部楼层 |阅读模式
自己看视频学习ci,发现视频的版本和2.0有很大的差别
第一个问题是视频中http://localhost/index.php/blog/index/是可以访问首页的,而我这里则是404。
第二个问题:

PHP复制代码
class Shufa extends CI_Controller {
       
       
        function __construct()
        {
                parent::__construct();
               
        }
 
        function index()
        {
                $data['page_title'] = "xxx";
                $data['news1'] = $this->Action->get_new1();
                $data['news2'] = $this->Action->get_new2();
                $this->load->view('header',$data);
                $this->load->view('index',$data);
                $this->load->view('footer');
        }
       
        function news()
        {
                $data['page_title'] = "xxx";
                $this->Action->get_content($this->url->segment(3));
                $this->load->view('header',$data);
                $this->load->view('news',$data);
                $this->load->view('footer');
        }
}
复制代码


写完这些后我在view下新建了news.php,但是无论怎么访问也都是404,求解
发表于 2011-4-18 14:00:16 | 显示全部楼层
http://localhost/index.php/Shufa/news/ 应该是你应该访问的地址
 楼主| 发表于 2011-4-18 14:09:06 | 显示全部楼层
上面的代码我是把blog给改掉了~
即使我在地址栏输入 http://localhost/index.php/shufa/index/   依然是404
发表于 2011-4-18 15:12:00 | 显示全部楼层
http://localhost/blog/index.php/shufa/index/   如果你有文件夹,要写上文件夹的

本版积分规则