Welcome Guest, Not a member yet? Register   Sign In
class Dashboard extends API
#1

[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
#2

[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




Theme © iAndrew 2016 - Forum software by © MyBB