构建url查询字符串,而不是在twig模板中包含多个值

On a search page with url than act like filter some argument can be set more than one time.

So in a twig template I'm trying to build an url like that:

app?param1=2&toto[]=3&toto[]=10&toto[]=20

How do you manage to do that in twig?

I'm already merging the request query with entity attribute (in a loop)

path('search', app.request.query.all | merge({state: state.id}))

Don't do this in you're view, build it in your controller and pass it down to the view.

Views should be logic-less IMO.