Symfony 1.4 z TCPDF: Jak pobrać dane z bazy danych i pokazać ją jako plik .pdf?

Pracuję z Symfony 1.4. Chcę utworzyć plik pdf za pomocą TCPDF z treścią zapytania obejmującego wiele tabel. Tutaj mój kod w actions.class.php:

public function executeTest()
{ 
     $this->conflictos1s = Doctrine_Core::getTable('Conflictos1')
      ->createQuery('a') 
      ->leftJoin('a.SectorActividadCiuTa7')     
      ->leftJoin('a.RelacionConflictualPrincipalTa9') 
      ->leftJoin('a.SubsectorActividadTa8')       
       ->leftJoin('a.DemandasTa2')      
       ->leftJoin('a.ActoresTa1')     
       ->leftJoin('a.Conflictos1HasActoresTa1')    
      ->orderBy('a.Id DESC')
            ->execute();  

  $config = sfTCPDFPluginConfigHandler::loadConfig();

  // pdf object
  $pdf = new sfTCPDF();

  // set document information
  $pdf->SetCreator(PDF_CREATOR);
  $pdf->SetAuthor('J. H.');
  $pdf->SetTitle('TCPDF Example 001');
  $pdf->SetSubject('TCPDF Tutorial');
  $pdf->SetKeywords('TCPDF, PDF, example, test, guide');

  // set default header data
 $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' 001', PDF_HEADER_STRING);

  // set header and footer fonts
  $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
  $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

  // set default monospaced font
  $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

  //set margins
  $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
  $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
  $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

  //set auto page breaks
  $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

  //set image scale factor
  $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

  // ---------------------------------------------------------

  // set default font subsetting mode
  $pdf->setFontSubsetting(true);

  // Set font
  // dejavusans is a UTF-8 Unicode font, if you only need to
  // print standard ASCII chars, you can use core fonts like
  // helvetica or times to reduce file size.
  $pdf->SetFont('dejavusans', '', 10);

  // Add a page
  // This method has several options, check the source code documentation for more information.

$pdf->AddPage();

$pdf->Write(0, '', '', 0, 'L', true, 0, false, false, 0);

$pdf->SetFont('helvetica', '', 6);
  // Set some content to print
 $html = $this->getPartial(
    'generar_pdf', 
    // put in this array all variables you want to give to the partial

   array('posts' => $posts)
  );
  $pdf->writeHTML($html, true, false, false, false, '');

  // ---------------------------------------------------------

  // Close and output PDF document
  // This method has several options, check the source code documentation for more information.
  $pdf->Output('example_conflictos.pdf', 'I');

  // Stop symfony process
  throw new sfStopException();
}

Oto mój kod szablonu (częściowy o nazwie _generar_pdf.php). Podążałem za radą tutaj:Używanie PHP z TCPDF do pobierania danych (przy użyciu mysql) z bazy danych i pokazywania ich jako plik .pdf

<?php ob_start(); ?>
<h2>Listado de Conflictos</h2>
<table cellspacing="1" border="1">       
  <thead>
    <tr>
      <th>Id</th>
       <th>Ver acciones<br>conflictivas</th>
      <th>Ver actores</th>
       <th>Fecha comienzo</th>
      <th>Relacion conflictual principal</th>
      <th>Sector actividad</th>
      <th>Subsector actividad</th>
      <th>Demandas</th>      
      <th>Descripcion-general</th>
      <th>Descripcion protagonista</th>
      <th>Descripcion antagonista</th>
      <th>Descripcion demandaprinc</th>
      <th>Nivel estado</th>
      <th>Descripcion sector</th>
      <th>Fecha final</th>
</tr>
</thead>
<tbody>
  <?php foreach ($conflictos1s as $conflictos1): ?>
    <tr>
      <td><?php echo $conflictos1->getId() ?></a></td>
      <td><?php echo date('d/m/Y', strtotime($conflictos1->getFechaComienzo())) ?></td>
      <td><?php echo $conflictos1->getRelacionConflictualPrincipalTa9() ?></td>
      <td><?php echo $conflictos1->getSectorActividadCiuTa7() ?></td>
      <td><?php echo $conflictos1->getSubsectorActividadTa8() ?></td>
      <td><?php echo $conflictos1->getDemandasTa2() ?></td>
       <td width="20%"><?php echo substr($conflictos1->getDescripcionGeneral(),0,60) ?></td> 
      <td><?php echo $conflictos1->getDescripcionProtagonista() ?></td>
      <td><?php echo $conflictos1->getDescripcionAntagonista() ?></td>
      <td><?php echo $conflictos1->getDescripcionDemandaprinc() ?></td>
      <td><?php echo $conflictos1->getNivelEstado() ?></td>
      <td><?php echo $conflictos1->getDescripcionSector() ?></td>
      <td><?php if(!is_null($conflictos1->getFechaFinal())){ echo date('d/m/Y', strtotime($conflictos1->getFechaFinal()));} ?></td> 
    </tr>
    <?php endforeach; ?>      
  </tbody>
</table>
<?php $posts = ob_get_contents();
ob_end_clean(); 
echo $posts ?>

Oto mój wynik: Nie widzę zmiennych danych. Co ja robię źle?

questionAnswers(1)

yourAnswerToTheQuestion