[eluser]doccer[/eluser]
Question for those using HMVC. Why is it that the function that calls the view doesn't pass in its class variables?
ie I have this:
Code:
class Admin extends Controller {
var $permissions;
function Admin()
{
parent::Controller();
$this->permissions = 1;
}
function index()
{
$this->load->view('admin');
}
}
and in the $this->load->view('admin'); view I have
Code:
<?=$this->permissions?>
I get an error that it doesnt exist.
This works in a native CI install.
The only way I can get around this is to add
Code:
$this->load->caller = $this;
in the HMVC Controller class
then call
Code:
<?=$this->caller->permissions?>
in my view.
Any thoughts?