I'm building a php cms and using Twig template engine. I'm now building the news archive page which shows page titles. Before Twig I would have done something like this:
$articles = $db->query("SELECT * FROM `articles` ORDER BY `id` DESC");
while ($article = $articles->fetch_assoc())
{
echo "<a href=\"article.php?id=".$article['id']."\">".$article['title']."</a><br />"
}
How do I do that with Twig?