Welcome Guest, Not a member yet? Register   Sign In
Call, another model in a model
#1

[eluser]chakhar86[/eluser]
Hi there,

I curious to know if it's possible to load a model inside model???

I've tried and it failed.

I think CI should have this feature. For example when we create a model representing a table which has a relation to another table (which I defined in another model).

I need suggestion...

sorry for bad english Smile

I've tried this,though:
Code:
class Has_something extends Model {
  
  var $something;
  
  function Has_something() {
    require_once('./system/application/models/something.php');
    $this->something[] = new Something();
  }
}

oh, yeah. Another thing, is it possible to pass a parameter to Model (or Library) constructor?


Messages In This Thread
Call, another model in a model - by El Forum - 11-26-2008, 05:52 AM
Call, another model in a model - by El Forum - 11-26-2008, 06:51 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:05 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:07 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:11 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:26 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:46 AM
Call, another model in a model - by El Forum - 11-26-2008, 07:57 AM
Call, another model in a model - by El Forum - 11-26-2008, 08:00 AM
Call, another model in a model - by El Forum - 11-26-2008, 08:39 AM
Call, another model in a model - by El Forum - 11-26-2008, 08:47 AM
Call, another model in a model - by El Forum - 11-26-2008, 05:57 PM
Call, another model in a model - by El Forum - 11-26-2008, 09:23 PM
Call, another model in a model - by El Forum - 11-27-2008, 08:01 AM
Call, another model in a model - by El Forum - 01-08-2009, 02:30 PM
Call, another model in a model - by El Forum - 01-08-2009, 07:42 PM



Theme © iAndrew 2016 - Forum software by © MyBB