Welcome Guest, Not a member yet? Register   Sign In
AutoLoad: can not load 3 library
#1

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

[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).
#3

[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.
#4

[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




Theme © iAndrew 2016 - Forum software by © MyBB