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
Post a Comment