In Symfony, writing:
{% with {} only %}
{{ app.request.attributes.get('_route') }}
{% endwith %}
leads to a Variable "app" does not exists.
Looks like global Twig variable are not accessible in a with block, maybe they should?
The globals should be available if you remove only, aren't they? If so, I don't think this should change.
@HeahDude yes they are. But this is quite inconsistent with {% include ... only %} and {% embed ... only %} where global variables are still available
hi all
the same with my problem ,
but this my problem ,
please help
http://stackoverflow.com/questions/41886683/how-to-add-extension-add-global-in-twig
fixed in #2933
Most helpful comment
@HeahDude yes they are. But this is quite inconsistent with
{% include ... only %}and{% embed ... only %}where global variables are still available