Welcome Guest, Not a member yet? Register   Sign In
Loading a model within a model.
#5

[eluser]CodeOfficer[/eluser]
this works great for me:
Code:
class MyModel extends Model
{
    private $CI;
    
    function MyModel()
    {
        parent::Model();
        $this->CI =& get_instance();    
    }
    
    function whatever()
    {
        $this->CI->load->model('model1');    
        $this->CI->model1->method1();
    }
    
    function woot()
    {
        $this->CI->load->model('model2');    
        $this->CI->model2->method2();    
    }
}


Messages In This Thread
Loading a model within a model. - by El Forum - 10-30-2007, 04:59 PM
Loading a model within a model. - by El Forum - 10-30-2007, 05:26 PM
Loading a model within a model. - by El Forum - 10-30-2007, 05:35 PM
Loading a model within a model. - by El Forum - 10-30-2007, 08:51 PM
Loading a model within a model. - by El Forum - 10-30-2007, 11:44 PM
Loading a model within a model. - by El Forum - 10-31-2007, 05:28 AM
Loading a model within a model. - by El Forum - 10-31-2007, 12:08 PM
Loading a model within a model. - by El Forum - 10-31-2007, 12:11 PM
Loading a model within a model. - by El Forum - 10-31-2007, 01:45 PM
Loading a model within a model. - by El Forum - 10-31-2007, 01:54 PM
Loading a model within a model. - by El Forum - 10-31-2007, 02:26 PM
Loading a model within a model. - by El Forum - 10-31-2007, 02:27 PM
Loading a model within a model. - by El Forum - 10-31-2007, 03:58 PM
Loading a model within a model. - by El Forum - 10-31-2007, 04:10 PM
Loading a model within a model. - by El Forum - 10-31-2007, 04:26 PM
Loading a model within a model. - by El Forum - 10-31-2007, 05:03 PM
Loading a model within a model. - by El Forum - 11-02-2007, 04:34 AM
Loading a model within a model. - by El Forum - 11-02-2007, 07:14 AM
Loading a model within a model. - by El Forum - 11-02-2007, 12:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB