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

Provide support for twig yielding #157

Open
diffy0712 opened this issue May 7, 2024 · 0 comments
Open

Provide support for twig yielding #157

diffy0712 opened this issue May 7, 2024 · 0 comments

Comments

@diffy0712
Copy link
Contributor

I open this issue to start a conversation and possibly find solution for yielding support for twig4.

Twig 3.9 introduced the use_yield option, which will be the only strategy in twig4. Read the changelog here.

Pull request #154 added support for the internal changes that were made in 3.9, but still relies on echo and the output buffer. (use_yield is off).

The yii2-twig library creates twig functions for yii's View helper functions (beginBody, endBody, beginPage etc...), which will echo their contents, which does not work in twig3.9 with use_yield. Note: endPage will modify the current output buffer (replacing the placeholders), which already has a workaround from 2.5.0.

I think a solution needs to be found to support yielding, because echo is deprecated from twig3.9 and will be removed in twig4.

CC: @schmunk42 @eluhr

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

1 participant