Organizational Research By

Surprising Reserch Topic

load a library in a model in codeigniter


load a library in a model in codeigniter  using -'codeigniter'

Why won't my model load the encryption library?

class User_model extends Model {

  function User_model() {
    parent::Model();
    $this->check_login();
  }

  function check_login() {
    $this->load->library('encrypt');
    $email = $this->encrypt->decode($email);
    ....
  }
}


This giving me a PHP error: Call to a member function decode() on a non-object on line X -- where X is the $this->encrypt->decode($email); line?

*Edited to show that the problem was that check_login was called from the constructor*
    

asked Sep 15, 2015 by Ashley26Eygt
0 votes
11 views



Related Hot Questions

6 Answers

0 votes
NULL
answered Sep 15, 2015 by howtobulkupfast533
0 votes
NULL
answered Sep 15, 2015 by LorBicheno
0 votes
NULL
answered Sep 15, 2015 by DennisKawamo
0 votes
NULL
answered Sep 15, 2015 by DYUAlvinvumh
0 votes
NULL
answered Sep 15, 2015 by BennyAllsopi
0 votes
NULL
answered Sep 15, 2015 by AudLavater

...