I'm using this .twig file to show the result of a query:
{% extends 'base.html.twig' %}
{% block body %}
{{parent()}}
<div class="container">
<div class="col-md-12">
{% for eq in equipos %}
<div class="row well">
<h2>{{ eq.nombre }}</h2>
<br>
<dl>
<dt>{{'CPU'}}</dt>
<dd>
{{ eq.cPU }}
</dd>
<br>
<dt>{{'GPU'}}</dt>
<dd>
{{ eq.gPU }}
</dd>
<br>
<dt>{{'RAM'}}</dt>
<dd>
{{ eq.rAM }}
</dd>
<br>
<dt>{{'HDD'}}</dt>
<dd>
{{ eq.hDD }}
</dd>
<br>
<dt>{{'Placa Base'}}</dt>
<dd>
{{ eq.placaBase }}
</dd>
<br>
<dt>{{'Sistema Operativo'}}</dt>
<dd>
{{ eq.sO }}
</dd>
<br>
<dt>{{'Garantia'}}</dt>
<dd>
{{ eq.garantia }}
</dd>
<br>
<dt>{{'Fecha de Compra'}}</dt>
<dd>
{{ eq.fechaCompra }}
</dd>
<br>
<dt>{{'Marca del Fabricante'}}</dt>
<dd>
{{ eq.marcaFabricante }}
</dd>
<br>
<dt>{{'Observaciones'}}</dt>
<dd>
{{ eq.observaciones }}
</dd>
<br>
</dl>
</div>
{% endfor %}
</div>
{% endblock %}
and this is the function which makes the query:
public function equiposverAction($id)
{
$session = new Session();
$em = $this->getDoctrine()->getManager();
$dql = "SELECT e FROM ClientBundle:Equipos e where e.idclient=$id";
$equipos = $em->createQuery($dql);
return $this->render('ClientBundle:Client:equiposver.html.twig',array('name'=>$session->get('name'), 'equipos'=>$equipos));
}
What happens is that the for cycle can't process the query for unknown reasons, even if I write something inside, it doesn't shows a certain number of times, and it should repeat three times because this query shows 3 results. I used the same method in other .twig files on my app, but I'm having this problem only here.