Welcome Guest, Not a member yet? Register   Sign In
My_Model don't auto Load by Core/Loader
#4

File : application/core/MY_Model.php


Code:
class MY_Model extends CI_Model
{

  // creer ici une propriete avec le nom de la database
  private $commun;

  public function __construct()
  {
    parent::__construct();
    log_message('debug', __CLASS__ . " Class Initialized");
   $this->commun = $this->load->database('commun', TRUE, TRUE);

    // Pass reference of database to the CI-instance
    $CI = & get_instance();
    // Creation d'une propriété dans la controlleur qui permet d'y acceder rapidement n'importe ou
    // $CI->my_data_base = & $this->my_data_base;
    $CI->commun = & $this->commun;
  }
}


On CI V3.0.0 I have the message "MY_Model Class Initialized" in the log.txt
On CI V3.0.4 I haven't this message, but with my code in system/core/Loader.php that's fine !

??

Thanks !
Reply


Messages In This Thread
My_Model don't auto Load by Core/Loader - by Pad - 01-26-2016, 11:53 PM
RE: My_Model don't auto Load by Core/Loader - by Pad - 01-27-2016, 01:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB