0

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);      
    }
?>

2 Answers 2

1

You need CI_Controller

class Login extends CI_Controller {
Sign up to request clarification or add additional context in comments.

Comments

1

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);      
    }

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.