开发者

CodeIgniter is doesn't work

So, I heard about CodeIgniter and I downloaded this. I tried to install CodeIgniter, but CodeIgniter doesn’t work. I writed a code in application/contollers in file name new.php:

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

Then I went in http://localhost/ci/index.php/New/, but I didn’t see anything. I tried a link: http://localhost/ci/index.php/New/index.php, but I didn’t see anything.

Help me, please!

EDIT: I use a 开发者_高级运维uWamp, there are Apache, MySQL and PHP. My CodeIgniter version is 2.0.2.


If you are using Codeigniter 2.x then

class New extends CI_Controller

And make sure you name the file lowercase. Class name must be uppercase, but file name lowercase.


class Newz extends CI_Controller {

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

    public function index()
    {
       echo "Hello";
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜