Welcome Guest, Not a member yet? Register   Sign In
Can't acccess personnal library
#8

(07-23-2016, 04:33 AM)PaulD Wrote: Hi,

In the library you extend CI as you have done.

The loader class is in the CI object, so you load the model via your CI instance:

PHP Code:
$this->CI->load->model('whatever_model'); 

The model though, as it is loaded into the CI instance, does not need to extend CI, just extends the CI_model as normal.
PHP Code:
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class 
Example_model extends CI_Model {
 
 public function 
__construct()
 {
 
   parent::__construct();
 }
 
 public function 
get_user()
 {
 
   $this->db->from('whatever');
 
   // etc etc.
 
}


Hope that helps

Paul

Thank you Paul for your help too. I knew i was not using an optimized way to code but it was a first shot .
Thank you veryyyy muchhhh !!
Reply


Messages In This Thread
Can't acccess personnal library - by Theo - 07-22-2016, 05:06 AM
RE: Can't acccess personnal library - by Avenirer - 07-22-2016, 06:07 AM
RE: Can't acccess personnal library - by Theo - 07-22-2016, 06:22 AM
RE: Can't acccess personnal library - by Wouter60 - 07-23-2016, 01:39 AM
RE: Can't acccess personnal library - by Theo - 07-23-2016, 04:08 AM
RE: Can't acccess personnal library - by PaulD - 07-23-2016, 04:33 AM
RE: Can't acccess personnal library - by Theo - 07-24-2016, 03:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB