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

视频例子的问题

[复制链接]
发表于 2008-2-2 17:15:47 | 显示全部楼层 |阅读模式
我按视频中的例子建立BLOG,webroot/index.php/blog/  这个能访问, 但做到 有 Comment 链接的时候,为什么 浏览webroot/index.php/blog/comments 显示的是找不到文件?路径没有错啊,是配置有问题吗?
发表于 2008-2-2 17:17:11 | 显示全部楼层
贴出你的控制器代码!
 楼主| 发表于 2008-2-2 17:21:30 | 显示全部楼层
<?php

class Blog extends Controller {

        function Blog()
        {
                parent::Controller();       
                //$this->load->scaffolding("entries");
                //$this->load->database();
                $this->load->helper('url');
                $this->load->helper('form');
        }
       
        function index()
        {
                $data['title']="MyBlog";
                $data['heading']="Blog Heading";
                $data['todo']=array('clean house','eat lunch','call mother');
                $data['query']=$this->db->get('entries');
                $this->load->view('blog_view',$data);
        }
        function comments()
        {
                $data['title']="MyComments";
                $data['heading']="Blog comments";
                //$data['query']=$this->db->get('entries');
                $this->load->view('comment_view',$data);
        }
        function comment_insert()
        {
                echo "good!";
        }
}
?>
 楼主| 发表于 2008-2-2 17:23:46 | 显示全部楼层
再发次清楚点的
PHP复制代码
 
<?php
 
class Blog extends Controller {
 
        function Blog()
        {
                parent::Controller();  
                $this->load->helper('url');
                $this->load->helper('form');
        }
       
        function index()
        {
                $data['title']="MyBlog";
                $data['heading']="Blog Heading";
                $data['todo']=array('clean house','eat lunch','call mother');
                $data['query']=$this->db->get('entries');
                $this->load->view('blog_view',$data);
        }
        function comments()
        {
                $data['title']="MyComments";
                $data['heading']="Blog comments";
                $this->load->view('comment_view',$data);
        }
        function comment_insert()
        {
                echo "good!";
        }
}
?>
 
复制代码
发表于 2008-2-2 17:28:16 | 显示全部楼层
看这个控制器代码没有问题,应该是 Web 服务器的问题。
发表于 2008-2-2 19:26:53 | 显示全部楼层
webroot/index.php/blog/comments不行,那么webroot/index.php/blog/comments/呢?(注意最后多一条斜杠)
发表于 2008-2-2 21:17:34 | 显示全部楼层
我告诉他试试加斜杠,他说也不行,我看了一下,他用的是 IIS,应该是 IIS 的问题,并且他的 PHP 是 CGI 模式的。

本版积分规则