I'm trying to check through Twig if there is a request in order to show the results of my searchBar, in Twig, ONLY if there is a request.
I found old symfony docs on app.request, but it doesn't seem to work for my 5.2 Symfony Project (here is my twig template) :
{% if app.request %}
<h3 class="main-header_h3">Résultats de la recherche</h3>
<hr>
<div class="grid">
{% for product in products %}
{% include 'product/_card.html.twig' with {product: product} only %}
{% endfor %}
</div>
<hr>
{%endif %}
Problem here is that my {% if app.request %}
isn't being interpreted, so I get my whole product
database coming on my view.
If you need any more code, let me know (Controller/Repository...) but the request definitely works, it's just my rendering in Twig that gives me trouble using that if
.