Welcome Guest, Not a member yet? Register   Sign In
Problems with models calling other models
#1

[eluser]swissbastian[/eluser]
Hi there

I've got some problems with models and I can't figure out what mistakes I made.

The browser tells me:
Quote:A PHP Error was encountered

Severity: Notice

Message: Undefined property: Dateim::$verzeichnism

Filename: models/dateim.php

Line Number: 308


Fatal error: Call to a member function verzeichnis_titel() on a non-object in /foo/bar/public_html/system/application/models/dateim.php on line 308

dateim and verzeichnism are models, verzeichnis_titel is a function from verzeichnism.

Line 308 of dateim.php:
Code:
$output = $this->verzeichnism->verzeichnis_titel($id);

verzeichnis_titel():
Code:
function verzeichnis_titel($id)
        {
            $query = $this->db->get_where('verzeichnisse', array('id' => $id));
            $zeile = $query->row();
            
            return $titel = $zeile->titel;
            
        }

Is it bad practice to call a model in another model?

Thanks for any help,
Bastian


Messages In This Thread
Problems with models calling other models - by El Forum - 04-06-2009, 12:35 AM
Problems with models calling other models - by El Forum - 04-06-2009, 01:28 AM
Problems with models calling other models - by El Forum - 04-06-2009, 02:34 AM
Problems with models calling other models - by El Forum - 04-06-2009, 02:43 AM
Problems with models calling other models - by El Forum - 04-06-2009, 02:58 AM
Problems with models calling other models - by El Forum - 04-06-2009, 03:28 AM
Problems with models calling other models - by El Forum - 04-06-2009, 04:32 AM
Problems with models calling other models - by El Forum - 04-06-2009, 04:45 AM
Problems with models calling other models - by El Forum - 04-06-2009, 06:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB