[eluser]Martenvanurk[/eluser]
Dear,
I'm using the following code:
Code:
$this -> load -> model ( 'AclModel' );
$this -> load -> model ('MenuModel');
$this -> MenuModel -> setAcl ( $this -> AclModel );
This is my model:
Code:
class MenuModel extends CI_Model {
/**
* Acces control list object
* @var object
*/
private $acl;
public function setAcl( &$acl )
{
$this->acl = $acl;
}
}
When I create an error in the model, CI report it fine. So the model is loaded normal.
But when I use the code in the first block in my controller I got the following error:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined property: Menu::$MenuModel
Filename: controllers/Menu.php
Line Number: 36
Line 36 is this line ( first code block): $this -> MenuModel -> setAcl ( $this -> AclModel );
In the code before this, I loaded the MenuModel without any problems. Will this cause the error? Think CI will use the Singleton or Dependency Injection container though.
How can I fix this error, the syntax is right I think.....
Kind regards!
Marten