0
我想在indexSuccess.php
類別中顯示標題和該類別的元素。這些是我的兩個表:獲取只有該類別的類別標題和元素 - symfony
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; ?>
我在做什麼這裏錯了嗎?謝謝