include syntax
rafipiccolo opened this issue ยท 4 comments
With latest twig there is a new way to do includes
Before
{% include('template.html') with vars %}
After
{{ include('template.html', vars) }}
is it going to be supported ?
The ecosystem is already moving forward and now it breaks my code :)
VincentLanglet/Twig-CS-Fixer#228
With latest twig there is a new way to do includes
For information, this is not new. Twig team has been recommending to not use the include
tag for years: https://twig.symfony.com/doc/3.x/tags/include.html
The include
function has been around since 2012 or so, and the recommandation against the include
tag since Twig 1.12 (2019 I think).
The ecosystem is already moving forward
The ecosystem has been moving forward 5 years ago. Joke aside, everybody moved to the include
function years ago, this is not a new trend.
Thanks! Good catch. Whether or not there is a trend to different usage patterns, I still believe we should try to match the feature set available in Twig PHP ๐
I totally agree.