CodeIgniter Forums

Full Version: class Dashboard extends API
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]jkevinburton[/eluser]
I want to create a library class called API which should extends the Controller.
So when I create controllers, all I have to do is say:

Code:
class Dashboard extends API {
     function Dashboard() {
             parent::API();
     }
}

I autoloaded the api class.. but when I ran the controller, it told me that API class didn't exist.....

any insight?

Kevin

El Forum

[eluser]Unknown[/eluser]
CI doesn't autoload the API.php file when called from a child.

Add
Code:
require('api.php');
above your "class Dashboard extends API {" and it should work.

Brad