I have an url like : MYURL?filter[_per_page]=25&filter[name][value]=hello
How can i get these parameters with twig ?
I'm trying {{ app.request.get('filter[_per_page]') }}
but it's always empty...
Thanks !
Edit : I'm in javascript an i want to assign this result to a javascript variable like : var param = "{{ app.request.get('filter[_per_page]') }}";
You can get the current URL in Twig/Silex 2 like this: global. request. attributes. get('_route') .
You must manage as an array accessing to the filter
element as:
{{ app.request.get('filter')['_per_page'] }}
(This time I try before posting...)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With