php - SYMFONY 3 Twig conditions route
858
I would like to know how with twig display something considering the route.
{% if visual|default %}
{{- wc_simple_visual(visual) -}}
{% else %}
<div >
//Display the image in functions of the routn name
{% if app.request.get('_route') != 'live' AND f app.request.get('_route') != 'contact' %}
<img src="/{{ asset_version('img/live-image.jpg') }}" alt="{% if title %}{{ title }}{% endif %}" >
{% else %}
<img src="/{{ asset_version('img/contact-image.jpg') }}" alt="{% if title %}{{ title }}{% endif %}" >
</div>
{% endif %}
but like this it doesn't works, thx.