Welcome Guest, Not a member yet? Register   Sign In
models within models
#3

[eluser]gtech[/eluser]
If you load the model inside the constructor you can load it in the normal way, outside the constructor you need to use ucantblamem's method. This has come up in previous posts before so you can search the forums, If it breaks the MVC rules then I slap myself on the wrists as I do it frequently, a cascading delete would be an example of when I load other models (e.g. when I delete users I also need to delete contents) and it seems silly just to rewrite other models methods.

Code:
class Contentsdb extends Model
{
  /**
   * The Initialisation method
   */
  function contentsdb()
  {
    parent::Model();
    $this->load->model('itemsdb');
  }


Messages In This Thread
models within models - by El Forum - 12-05-2007, 11:08 PM
models within models - by El Forum - 12-05-2007, 11:59 PM
models within models - by El Forum - 12-06-2007, 01:52 AM
models within models - by El Forum - 12-06-2007, 06:24 PM



Theme © iAndrew 2016 - Forum software by © MyBB