I want to show in an indexSuccess.php
categories titles and the elements of that categories. These are my two tables:
SgpsCategories:
columns:
description: { type: string(255), notnull: true }
SgpsCertificats:
actAs: { Timestampable: ~ }
columns:
categories_id: { type: integer, notnull: true }
titre: { type: string(255), notnull: true }
type: { type: string(255), notnull: true }
taille: { type: string(50), notnull: true }
chemin: { type: string(255), notnull: true }
relations:
SgpsCategories: { onDelete: CASCADE, local: categories_id, foreign: id }
So far I did this in the action:
public function executeIndex(sfWebRequest $request)
{
$this->categories = Doctrine_core::getTable('SgpsCategories')
->createQuery('b')
->execute();
$this->sgps_certificatss = Doctrine_Core::getTable('SgpsCertificats')
->createQuery('a')
->execute();
}
and i did this in the indexSuccess.php:
<?php foreach ($categories as $categorie): ?>
<div id="titulo-certificado"><?php echo $categorie->getDescription(); ?></div>
<?php foreach ($sgps_certificatss as $sgps_certificats): ?>
<?php echo $sgps_certificats->getTitre()."<br>";?>
<?php endforeach; ?>
<?php endforeach; ?>
What am I doing wrong here? thank you