• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.