我想在indexSuccess.php
类别标题和该类别的元素中显示。这是我的两张桌子:
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 }
到目前为止,我在行动中做到了这一点:
public function executeIndex(sfWebRequest $request)
{
$this->categories = Doctrine_core::getTable('SgpsCategories')
->createQuery('b')
->execute();
$this->sgps_certificatss = Doctrine_Core::getTable('SgpsCertificats')
->createQuery('a')
->execute();
}
我在 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; ?>
我在这里做错了什么?谢谢你