I'm currently working on a Symfony 2.7 and I have in my controller 3 arrays. But I want to show all of this 3 arrays in one array in the view. Someone know
You can see the return in my controller here with my 3 arrays (entities, tabStatus and tabName) I can't merge the arrays in one.
return $this->render('testAdminBundle:Default:showBt.html.twig',
array('entities' => $entities, 'tabStatus' => $tabStatus, 'tabName' => $tabName));
And here my view :
<div class="bs-example">
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Login</th>
<th>Status</th>
<th>Items</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{% for value in entities %}
<tr>
<td></td>
<td>{{ value.login }}</td>
<td></td>
<td>{{ value.items }} / 2400</td>
<td></td>
</tr>
{% endfor %}
</tbody>
</table>
</div><!-- /example -->
<br>
You can see in my view i show only the array entites because I can't put the 2 others arrays in the for. It is event possible to do something like this : {% for value1 in entities, value2 in tabStatus, value3 in tabName %} ? Or maybe I need to use key in twig ?
Thanks per advance !
PokeRwOw
$entities, $tabStatus, $tabNameto one array?