Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2013, 20:00
lmgonzalves
 
Fecha de Ingreso: mayo-2013
Mensajes: 17
Antigüedad: 11 años
Puntos: 0
Pregunta Variable no muestra su valor en Twig

Este es mi controlador:

Código PHP:
Ver original
  1. public function listado_oficialesAction() {
  2.         $em = $this->getDoctrine()->getEntityManager();
  3.         $oficiales = $em->getRepository('InvestigacionesPolicialesBundle:Oficial')->findAll();
  4.         return $this->render("InvestigacionesPolicialesBundle:Oficial:listado_oficiales.html.twig", array('oficiales' => $oficiales));
  5.     }

Y en mi vista tengo esto:

Código HTML:
Ver original
  1. <table class="listado" border="1">
  2.     <thead>
  3.         <tr>
  4.             <th>ID</th>
  5.             <th>CI</th>
  6.             <th>Nombre</th>
  7.             <th>Apellidos</th>
  8.         </tr>
  9.     </thead>
  10.     {% for oficial in oficiales %}
  11. <tr>
  12.     <th>{{ oficial.id }}</th>
  13.     <th>{{ oficial.ci }}</th>
  14.     <th>{{ oficial.nombre }}</th>
  15.     <th>{{ oficial.apellidos }}</th>
  16. </tr>
  17.     {% endfor %}

El problema es que no me muestra el ID, sin embargo los demás datos me los muestra sin problemas.