0

I am facing a Fatal error:

Class 'Controller' not found in D:\wamp\www\CodeIgniter\application\controllers\blog.php on line 3

1

2 Answers 2

4

Are you using CI 2.O? Did you by any chance write the following in your controller:

class Blog extends Controller { ... }

If you're using CI 2.0, you should use the following:

class Blog extends CI_Controller { ... }

You might have been watching outdated tutorials for CI 1.7.

Reference: http://codeigniter.com/user_guide/general/controllers.html

Make sure to follow the userguide along with whatever tutorials you're following; there's some changes in 2.0 which you should be aware of. You can still follow these tutorials though, just keep your eyes open and compare with the userguide.

Sign up to request clarification or add additional context in comments.

Comments

1

What version are you using? if you're using the latest (2.0.2), make sure you use CI_Controller when extending your controller. Seeing you named the file blog.php, your controller should be looking like this

Class Blog extends CI_Controller {

 function index()
{
  // your code...
}

}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.