user2969888
user2969888

Reputation: 3

Class not found in codeigniter

In the below code i have used codeigniter code i have found a error class not found. Class 'Controller' not found in C:\wamp\www\todo1\application\controllers\login.php on line 3

<?php

class Login extends Controller {

    function index()
    {
        $data['main_content'] = 'login_form';
        $this->load->view('includes/template', $data);      
    }
?>

Upvotes: 0

Views: 1268

Answers (2)

Aleksandr  Cerleniuk
Aleksandr Cerleniuk

Reputation: 96

You need CI_Controller

class Login extends CI_Controller {

Upvotes: 1

mamdouh alramadan
mamdouh alramadan

Reputation: 8528

In codeigniter ( I think version 2.x.x ) you should use the following instead:

class Login extends CI_Controller {

    function index()
    {
        $data['main_content'] = 'login_form';
        $this->load->view('includes/template', $data);      
    }

Upvotes: 1

Related Questions