CodeIgniter Forums
AutoLoad: can not load 3 library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: AutoLoad: can not load 3 library (/showthread.php?tid=10699)



AutoLoad: can not load 3 library - El Forum - 08-09-2008

[eluser]Unknown[/eluser]
auto load config:
$autoload['libraries'] = array('pagecontent', 'database', 'checkpermission');

Code:
class MyClass extends Controller{
  function MyClass() {
    parent:: Controller();
  }
  function myfunc() {
    $param = '1|1|1|1';
    $this->checkpermission->permit($param);  
  }
}
I call $this->checkpermission in class Myclass
Error:
Unknow MyClass::$checkpermission

Plz help!


AutoLoad: can not load 3 library - El Forum - 08-09-2008

[eluser]Michael Wales[/eluser]
I would make sure the library is actually being loaded (no syntax errors, etc). CodeIgniter has no problem autoloading 3 libraries (or 12, or 50, etc).


AutoLoad: can not load 3 library - El Forum - 08-09-2008

[eluser]valarkin[/eluser]
Hello Nhat Lea welcome to the CI forums!

What I would do is var_dump($this->checkpermissions) to see the information. This should let you check on your functions availability among other things. If it comes back NULL then the library is not being loaded. As Michael said, it sounds as if the library is not being loaded. Would you mind posting the code for Checkpermission.php? Then perhaps we might be able to help further.


AutoLoad: can not load 3 library - El Forum - 08-10-2008

[eluser]Unknown[/eluser]
Hmmmm, I'm sry!
checkpermissions class is put in ROOT-libraries but i don't name it CI_checkpermissions or MY_checkpermission.
This is fixed !
Thanks