symfony - How to get params in twig file -


how can use $_get params in twig file using php , alerting js.

uri-> ?comment=added...

in twig,

    if($_get['comment'] == "added"){      ...echo '<script>alert("in twig file!");</script>';     } 

hope you

{% if app.request.get('comment') == "added" %}     <script>alert("in twig file!");</script> {% endif %} 

Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -