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

varPrint and templatePrint are not working with renderToString #324

Open
Khartir opened this issue Dec 9, 2022 · 0 comments
Open

varPrint and templatePrint are not working with renderToString #324

Khartir opened this issue Dec 9, 2022 · 0 comments

Comments

@Khartir
Copy link

Khartir commented Dec 9, 2022

Version: 3.0

Bug Description

Adding {varPrint} or {templatePrint} to a template that is rendered with renderToString creates an empty output.

Expected Behavior

Actual output of {varPrint} or {templatePrint} is sent.

Possible Solution

The cause for this bug is the start of an output buffer in Template::capture that is than discarded due to the printers calling exit.

Instead of calling exit a custom exception could be thrown, that is caught in Template::capture to output the current buffer and exit then. It could also be caught in Engine::render and to just call exit there.

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