Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include syntax #892

Closed
rafipiccolo opened this issue May 10, 2024 · 4 comments
Closed

include syntax #892

rafipiccolo opened this issue May 10, 2024 · 4 comments

Comments

@rafipiccolo
Copy link

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

@ericmorand
Copy link
Contributor

ericmorand commented May 10, 2024

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.

@RobLoach
Copy link
Collaborator

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 👍

@ericmorand
Copy link
Contributor

I totally agree.

@twigjs twigjs deleted a comment from OpneSourceGame-UE5 May 15, 2024
@willrowe
Copy link
Collaborator

Duplicate of #392

@willrowe willrowe marked this as a duplicate of #392 May 22, 2024
@willrowe willrowe closed this as not planned Won't fix, can't repro, duplicate, stale May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants