I want to show columns of two tabels which are in relation.
My models looks as follows:
class Application_Model_DbTable_Ribadocsveranstaltung extends Zend_Db_Table_Abstract
{
protected $_name = 'riba_docs';
protected $_primary = 'docid';
protected $reference_Map = array(
'riba_veranstaltung' => array(
'columns' => 'riba_veranstaltung',
'refTableClass' => 'riba_veranstaltung',
'refColumns'=>'id'
)
);
My controller fetches all data:
$documents = new Application_Model_DbTable_Ribadocsveranstaltung();
$this->view->ribadocs = $documents->fetchAll();
In my view I have a html table output which I built like this (snippet)
foreach($this->ribadocs as $document) :
?>
<tr>
<td class="row_<?PHP echo $i % 2;?>"><?php echo
this->escape($document->docid);?></td>
Question: How can I get for example the column veranstaltung from my table riba_veranstaltung instead of the foreign key field veranstaltung from my table riba_docs? I've read all tutorials I could find until now, but I didn't get a satifying answer.