Welcome Guest, Not a member yet? Register   Sign In
Can't call custom library functions in my extended model (upgrading from 1.7.2. to 2.0.2)
#1

[eluser]ray023[/eluser]
I have an extended model:

Code:
class MY_Model extends CI_Model
{
    protected $is_admin = false;
    protected $facility_id = 0;
    protected $current_user = 'not set';
                    
    public function __construct()
    {
        parent::__construct();
        $this->load->library('ion_auth');
        //Blows up here:        
        $user    =    $this->ion_auth->get_user();
        
    }

The function in the ion_auth will not get called.
I get the following message:
Message: Undefined property: Welcome::$ion_auth
And then the following error:
Fatal error: Call to a member function get_user() on a non-object in c:\...\application\core\MY_Model.php on line 30

The library is loaded, but even when I do something like this it doesn't get called:
Code:
$CI =& get_instance();
        $CI->load->library('ion_auth');
        echo $CI->ion_auth->get_user();
    }

What could I have configured wrong during the upgrade?

NOTE: my extended controller is working fine.


Messages In This Thread
Can't call custom library functions in my extended model (upgrading from 1.7.2. to 2.0.2) - by El Forum - 04-20-2011, 08:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB