I am having issue rendering a nested array in Twig. this is my PHP logic where I am able to get other fields such as name URL but not array data. please check twig code, I think I am doing something wrong there. Error: An exception has been thrown during the rendering of a template ("Notice: Array to string conversion").
foreach ($arrays as $array) {
foreach ($array as $key => $value) {
$allProjects[$key][] = $value;
}
}
{% for project in projects %}
<tr>
<td>{{ project.name }}</td>
<td>{{ project.url }}</td>
<td>{{ project.assingedApprover }}</td>
<td></td>
</tr>
{% endfor %}
Json Data
[
{
"name": "Resolute Energy Corporation",
"url": "http://msu.edu",
"assignedAprover": [
{
"firstName": "Joe",
"lastName": "lastName"
},
{
"firstName": "men",
"lastName": "gen"
}
]
},
{
"name": "CBL & Associates Properties, Inc.",
"url": "http://acquirethisname.com",
"assignedAprover": [
{
"firstName": "Joe",
"lastName": "lastName"
},
{
"firstName": "men",
"lastName": "gen"
}
]
},
]
items?