Welcome Guest, Not a member yet? Register   Sign In
Extended Controller class not found - stumped!
#1

[eluser]CodeSpeed[/eluser]
I'm developing a billing software (it's more of an experiment to get familiar with CI) and I was doing so under Windows XP with no problems.

I recently switched to Linux and I started getting a "class not found" error, I thought it might have been because of incorrect filenaming (linux is case sensitive) but after a code review I found no such errors.

So I downloaded CI again and setup a clean install.

Then I proceeded to extend the controller class with only a constructor to keep it simple:

Code:
<?php
/* FILE 'application/libraries/my_controller.php' */

class MY_Controller extends Controller
{
    public function __construct()
    {
        parent::__construct();
    }
}
?>

Then in the 'application/controllers/welcome.php' controller I changed the name of the "Controller" class it extends to my new extended class "MY_Controller"

Code:
<?php

class Welcome extends MY_Controller
{
    public function Welcome()
    {
        parent::__construct();    
    }

    public function index()
    {
        $this->load->view('welcome_message');
    }
}

/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */

Then I run the site and I get

Quote:Fatal error: Class 'MY_Controller' not found in /home/joseph/public_html/samp/system/application/controllers/welcome.php on line 4

But if I add this to the beginning of the welcome.php file, it will work.

Code:
require_once(APPPATH.'libraries/my_controller.php');

So CI is not being able to see the extension file. Maybe it's a path problem since I didn't have this problem under Windows, but I ran out of ideas.

What am I doing wrong??? I hope you can help me Sad

Thank you!


Messages In This Thread
Extended Controller class not found - stumped! - by El Forum - 11-16-2008, 01:19 PM
Extended Controller class not found - stumped! - by El Forum - 11-16-2008, 02:00 PM
Extended Controller class not found - stumped! - by El Forum - 11-16-2008, 02:10 PM
Extended Controller class not found - stumped! - by El Forum - 11-16-2008, 02:22 PM
Extended Controller class not found - stumped! - by El Forum - 08-04-2009, 02:52 PM
Extended Controller class not found - stumped! - by El Forum - 10-20-2009, 02:35 PM
Extended Controller class not found - stumped! - by El Forum - 10-20-2009, 02:50 PM
Extended Controller class not found - stumped! - by El Forum - 10-20-2009, 05:10 PM
Extended Controller class not found - stumped! - by El Forum - 10-20-2009, 09:45 PM
Extended Controller class not found - stumped! - by El Forum - 10-21-2009, 06:56 AM
Extended Controller class not found - stumped! - by El Forum - 10-21-2009, 07:04 AM
Extended Controller class not found - stumped! - by El Forum - 10-21-2009, 07:16 AM
Extended Controller class not found - stumped! - by El Forum - 10-24-2009, 11:02 AM
Extended Controller class not found - stumped! - by El Forum - 10-24-2009, 11:46 AM
Extended Controller class not found - stumped! - by El Forum - 03-18-2011, 05:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB