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? -

html - Unable to style the color of bullets in a list -

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