Twig Symfony2 get Request variable

user2143356 picture user2143356 · Apr 8, 2013 · Viewed 61.7k times · Source

I know I can do this:

app.request.get('name')

...but how do I do this?

app.request.get(twig_var_name)

I've tried every obvious solution {{}} () etc.

Is it possible?

Answer

S.Thiongane picture S.Thiongane · Apr 8, 2013

have you tried :

app.request.get('' ~ twig_var_name)