title: For loop sending wrong value- twig
body: <p>I am trying to read different results from different entities in one twig page.
  The first loop sends the right results but the second one sends the data from the first loop (Article)</p>
  <p>twig code to read Article :</p>
  <pre><code>  {% for article in article %}     
  
                  &lt;div class=&quot;item&quot;&gt;
                      &lt;div class=&quot;card mb-0 item-card2-card&quot;&gt;
                          &lt;div id=&quot;image-slider&quot; class=&quot;carousel&quot; data-ride=&quot;carousel&quot;&gt;
                              &lt;div class=&quot;carousel-inner&quot; role=&quot;listbox&quot; style=&quot; width:100%; height: 270px !important;&quot;&gt;
                                  &lt;div class=&quot;carousel-item active&quot;&gt;
                                      &lt;img src={{ asset('uploads/' ~ article.image ) }} alt=&quot;img&quot; class=&quot;cover-image&quot; &gt;
                                  &lt;/div&gt;
                                  
                              &lt;/div&gt;
                              &lt;a class=&quot;carousel-control-prev left-0&quot; href=&quot;#image-slider&quot; role=&quot;button&quot; data-slide=&quot;prev&quot;&gt;
                                  &lt;i class=&quot;carousel-control-prev-icon fa fa-angle-left&quot;&gt;&lt;/i&gt;
                                  &lt;span class=&quot;sr-only&quot;&gt;Previous&lt;/span&gt;
                              &lt;/a&gt;
                              &lt;a class=&quot;carousel-control-next right-0&quot; href=&quot;#image-slider&quot; role=&quot;button&quot; data-slide=&quot;next&quot;&gt;
                                  &lt;i class=&quot;carousel-control-next-icon fa fa-angle-right&quot;&gt;&lt;/i&gt;
                                  &lt;span class=&quot;sr-only&quot;&gt;Next&lt;/span&gt;
                              &lt;/a&gt;
                              &lt;div class=&quot;item-card7-overlaytext&quot;&gt;
                                  &lt;h4 class=&quot;mb-0&quot;&gt;${{article.prix}}&lt;/h4&gt;
                              &lt;/div&gt;
                              &lt;div class=&quot;item-card2-img1&quot; data-toggle=&quot;modal&quot; data-target=&quot;#gallery&quot;&gt;
                                  &lt;span class=&quot;badge bg-dark-transparent6 text-white fs-14 font-weight-semibold2&quot;&gt;&lt;i class=&quot;fe fe-image &quot;&gt;&lt;/i&gt; 5&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class=&quot;item-card2-icons&quot;&gt;
                              &lt;a href=&quot;#&quot; class=&quot;item-card2-icons-l bg-primary&quot;&gt; &lt;i class=&quot;fa fa-shopping-cart&quot;&gt;&lt;/i&gt;&lt;/a&gt;
                              &lt;a href=&quot;#&quot; class=&quot;item-card2-icons-r bg-secondary&quot;&gt;&lt;i class=&quot;fa fa fa-heart-o&quot;&gt;&lt;/i&gt;&lt;/a&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;card-body&quot;&gt;
                              &lt;div class=&quot;item-card2&quot;&gt;
                                  &lt;div class=&quot;item-card2-desc&quot;&gt;
                                      &lt;div class=&quot;item-card2-text&quot;&gt;
                                          &lt;a href=&quot;#&quot; class=&quot;text-dark&quot;&gt;&lt;h4 class=&quot;font-weight-bold mb-3&quot;&gt;   {{article.nom}}
  
                                              &lt;/h4&gt;&lt;/a&gt;
                                      &lt;/div&gt;
                                      &lt;p class=&quot;mb-0&quot;&gt;{{article.description}}&lt;/p&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                          &lt;div class=&quot;card-footer d-flex&quot;&gt;
                              
                              &lt;div class=&quot;item-card2-rating mb-0 ml-auto&quot;&gt;
                                  &lt;div class=&quot;star-ratings start-ratings-main clearfix d-inline-flex&quot;&gt;
                                      &lt;div class=&quot;stars stars-example-fontawesome stars-example-fontawesome-sm mr-2&quot;&gt;
                                          &lt;select class=&quot;example-fontawesome&quot; name=&quot;rating&quot; autocomplete=&quot;off&quot;&gt;
                                              &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;
                                              &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
                                              &lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
                                              &lt;option value=&quot;4&quot; selected&gt;4&lt;/option&gt;
                                              &lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;
                                          &lt;/select&gt;
                                      &lt;/div&gt; 
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
  
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              {% endfor %}
  </code></pre>
  <p>Twig code to read Repas variables :</p>
  <pre><code>{% for repas in repas %}
  
                  &lt;div class=&quot;item&quot;&gt;
                      &lt;div class=&quot;item-card overflow-hidden mb-0&quot;&gt;
                          &lt;div class=&quot;item-card-desc&quot;&gt;
                              &lt;a href=&quot;{{ path('singlerepas_show', { 'id': repas.id }) }}&quot;&gt;&lt;/a&gt;
                              
                              &lt;div class=&quot;card text-center overflow-hidden mb-0&quot;&gt;
                                  &lt;div class=&quot;card-img&quot;&gt;
                                      &lt;img src=&quot;../../assets/images/locations/germany1.jpg&quot; alt=&quot;img&quot; class=&quot;cover-image&quot;&gt;
                                  &lt;/div&gt;
                                  &lt;div class=&quot;item-card-text text-left&quot;&gt;
                                      &lt;div class=&quot;star-ratings start-ratings-main clearfix&quot;&gt;
                                          &lt;div class=&quot;stars stars-example-fontawesome stars-example-fontawesome-sm text-left&quot;&gt;
                                              &lt;select class=&quot;example-fontawesome&quot; name=&quot;rating&quot; autocomplete=&quot;off&quot;&gt;
                                                  &lt;option value=&quot;1&quot;&gt;1&lt;/option&gt;
                                                  &lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
                                                  &lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
                                                  &lt;option value=&quot;4&quot; selected&gt;4&lt;/option&gt;
                                                  &lt;option value=&quot;5&quot;&gt;5&lt;/option&gt;
                                              &lt;/select&gt;
                                          &lt;/div&gt;
                                      &lt;/div&gt;
                                      
                                      &lt;h4 class=&quot;mb-2&quot;&gt;{{ repas.nom }}&lt;/h4&gt;
                                      &lt;small class=&quot;text-white&quot;&gt;&lt;i class=&quot;fe fe-map-pin&quot;&gt;&lt;/i&gt; 8 Cities  &lt;i class=&quot;ml-3 fe fe-eye&quot;&gt;&lt;/i&gt; 140+ Tour Places &lt;/small&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
  
              {% endfor %}
  </code></pre>
  <p>The issue is, that it reads Article entity in the second loop, I looked online but found nothing concrete.
  I am pretty sure the problem isn't the controller or any other file, but maybe there is another way on how to write diffrent loops ? ?</p>
  <p>Controller code :</p>
  <pre><code>    public function index(Request $reques): Response
  {
      $Repository=$this -&gt; getDoctrine () -&gt; getRepository (repas::class);
      $repas= $Repository -&gt; findAll();
  
      $Repository=$this -&gt; getDoctrine () -&gt; getRepository (article::class);
      $article= $Repository -&gt; findAll();
  
  
  
  
  
  
      return $this-&gt;render('index/index.html.twig', [
          'repas' =&gt; $repas,
          'article'=&gt;$article,
  
  
      ]);    
  </code></pre>
  <p>I tried to dump the variable inside the loop in twig <code>{{ dump(article)}}</code>and <code>{{dump(repas)}}</code></p>