Skip to content

Basics

Clearing cache

    php bin/console cache:clear  

Routes

The routes are defined in config/routes.yaml. Documentation

Pass data to template

You can pass data to the template in an array format as a second parameter in the render method

return $this->render('/scheduledcomments/admin-comments.html.twig', ['types' => $types]);

Twig

for loop

<h1>Members</h1>
<ul>
    {% for user in users %}
        <li>{{ user.username|e }}</li>
    {% endfor %}
</ul>

More details here