-
Notifications
You must be signed in to change notification settings - Fork 24
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
Engine option to echo rendered output #37
Comments
Not against it. It could appear easier than it is because Will try to do it for 0.7, but if you think you can do it and make a PR, I will be happy to merge. |
Another option might be a convenience function? Or.... doing something like "compile" for just creating the string? I could see something like splitting into |
An helper method sounds ok. For BC I want to leave What do you think? |
Perfect. ^_^ It may seem like a small thing, but I would likely use |
and `WritableEngineInterface`. Purpose is to facilitate the echoing of rendered content and the usage of Foil as file builder. See #37
@matthew-dean I took this a bit further... I noticed that some people is already using Foil as a file builder (and they are happy Moreover, This is why I thought to introduce a When the third parameter ( However, it is also possible to provide a third parameter as:
In this way, I facilitate both the echoing of rendered template and the usage of Foil as file builder. The implementation is currently in a separate branch, you can see it here: b8e9439 As soon as I can, I'll write some unit tests and then include this change in 0.7 release, that will probably released in the first half of July. I'll appreciate your feedback. If you want to do some tests meanwhile, you can require Foil using |
What do you think about other option for method name? For example: display | includeTemplate | insert? For me "includeTemplate" sounds most intuitive, like native-php "include". However "write" seems more shortly and easy for use too. |
Hi, I'd love an engine option to echo the output when you call
$this->render()
(instead ofecho $this->render()
. The reason being that it makes things more consistent when used with systems like Slim, where "render" echoes the output on a view.I can't think of a reason where I'd ever use "render" without
echo
. I can think of reasons why others might, but echoing seems like it should be the default option. But, for backwards compatibility, being able to drop theecho
word would make my code more consistent.The text was updated successfully, but these errors were encountered: