-
Notifications
You must be signed in to change notification settings - Fork 847
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
echo/print functions #244
Comments
@oscarotero I've thought about this myself, but never proposed it. Adding it would almost certainly be a breaking change though, since it could create variable name collisions with existing templates. FWIW, you can get something like what you're describing by calling @mde would need to make a decision on whether we will ever add official support for a print/echo function. |
A solution to prevent the breaking change could be having an option to configure this. For example: ejs.render(str, data, { appendFunction: 'echo'; }); By default this could be |
@oscarotero That's a possible solution, in fact I kind of like it. @mde will have the final decision, though. |
I think this is a reasonable approach. It doesn't bloat the lib, and is opt-in. We would want to make sure it doesn't break the line count in our error handling. @oscarotero, would you like to put together a PR for this? |
Here's the PR #248 🎉 |
PR merged, thanks! |
Hi, thanks for this nice library. 😃
It would be great to have a print/echo function like in php to output code inside a funcion. For example:
I don't know if this is possible and easy to implement, but it would be really useful.
The text was updated successfully, but these errors were encountered: