Welcome Guest, Not a member yet? Register   Sign In
Extended Controller not working on App Engine
#1

(This post was last modified: 02-27-2015, 04:24 AM by mr_pablo.)

In my CI 2.2 setup, I have MY_Controller extending CI_Controller, then Admin_Controller extend MY_Controller.

On LAMP/WAMP, this worked perfectly, using the following code in config.php to load the files

Code:
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        if (file_exists($file = APPPATH . 'core/' . $class . EXT))
        {
            include $file;
        }

        elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT))
        {
            include $file;
        }
    }
}

I have recently moved to using Googles App Engine and now I am having issues with getting the Admin_Controller to work. MY_Controller seems to load fine, no issues.

I even tried renaming the admin controller to MY_Admin_Controller, but that didn't help.

Any ideas?

EDIT - right, so I tried adding "include_once( APPPATH . 'core/Admin_Controller.php' );" to the autoload function. No luck. I then added it to the top of the admin index.php script, and it works. So, why isn't it being autoloaded?
Reply
#2

(This post was last modified: 02-27-2015, 05:14 AM by InsiteFX.)

Try putting your Admin_Controller class inside your MY_Controller class and see if it will work, that's how I do it.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

So literally:

Code:
<?php
class MY_Controller extends CI_Controller
{
    public function __construct() {
        parent::__construct();
    }
}

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

?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB