I have the class categroies
and class Products
.
In my repository i have function
getProducts($categoryid,$location)
I need to loop in twig template like this
{% for category in categories %}
--{{ category.name }}--
{% for product in getProducts(category.id,location) %}
--{{ product.name }}--
{% endfor %}
{% endfor %}
or is there any better way for that