CodeIgniter不起作用

时间:2011-05-14 07:41:56

标签: codeigniter

所以,我听说过CodeIgniter,我下载了这个。我试图安装CodeIgniter,但CodeIgniter不起作用。我在应用程序/控制器中编写了一个代码,文件名为new.php:

class New extends Contoller 
{  
   function index()
   {
      echo "Hello word";
   }
}  

然后我进入了http://localhost/ci/index.php/New/,但我没有看到任何东西。我尝试了一个链接:http://localhost/ci/index.php/New/index.php,但我没有看到任何内容。

请帮帮我!

编辑:我使用的是uWamp,有Apache,MySQL和PHP。我的CodeIgniter版本是2.0.2。

2 个答案:

答案 0 :(得分:1)

如果您使用的是Codeigniter 2.x,那么

class New extends CI_Controller

并确保将文件命名为小写。类名必须为大写,但文件名必须为小写。

答案 1 :(得分:1)

class Newz extends CI_Controller {

    public function __construct()
    {
       parent::__construct();
    }

    public function index()
    {
       echo "Hello";
    }
}
相关问题