04-06-2009, 12:35 AM
[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:
dateim and verzeichnism are models, verzeichnis_titel is a function from verzeichnism.
Line 308 of dateim.php:
verzeichnis_titel():
Is it bad practice to call a model in another model?
Thanks for any help,
Bastian
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