I have a public function in MY_Controller is_logged, I want to use this in my view file like so:
<?php if( $this->is_logged() ): ?>
Hey user.
<?php else: ?>
Please login first.
<?php endif; ?>
but I got an error:
Call to undefined method CI_Loader::is_logged()
How can I use this in my view file?
Regards.
$CI =& get_instance();in the helper to get the$CIobject if you need it.