I have a .php file with a converted API inside from which I go to get the data, the code is this:
<?php $api_data = json_decode(file_get_contents('https://prova1api.herokuapp.com/RedHotCHiliPeppersDiscography'), true);?>
then I have an .html.twig file with this *code:
<div class="container">
{% for row in api_data %}
<div class="singlePostContainer">
<span class="postNumber">
01
</span>
<div class="postTextContainer">
<div class="postTitle">
{{row.album}}
</div>
<div class="postDate">
{{row.anno}}
</div>
<div class="postAuthor">
author
</div>
</div>
</div>
{% endfor %}
</div>
how do I get them to communicate?
if I use: {% include 'twig / floatingAPI.php' with {'truncate': truncate}%}
it doesn't work, it gives me an error
- sorry, I don't know why it doesn't display the divs