Привет, вот php код
$posts = mysql_query("SELECT * FROM ".$db_prefix."posts");
$posts = mysql_fetch_array($posts);
foreach($posts as $key => $value){
$name_post = $posts["name"];
$mini_desc = $posts["mini_desc"];
$view = $posts["view"];
$date = $posts["date"];
$min_img = $posts["img"];
}
А вот то что в twig шаблоне
{% extends "main.html" %}
{% block content %}
{% for posts in key %}
<div id="content">
<div class="post-item ">
<h2><a href="blog/">{{ name_post }}</a></h2>
<div class="img-conteiner">
<img src="/images/icons/708.jpg" />
</div>
<p>{{ mini_desc}}</p>
<div class="clear"></div>
<div class="post-info">
<span class="date_add">{{ date }}</span>
<span style="background: #0ba0dd;" class="post-rub"><a href="blog/moi-sobyitiya.html">{{ cat }}</a></span>
<span class="views">Просмотров: {{ view }}</span>
</div>
{% endfor %}
{% endblock %}
Не получается вывести цикл с записями.