-
-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add ability to render view from string #19
Comments
Use old good |
@klimov-paul why would you ever recommend |
@klimov-paul, are you serious? |
I've updated my response above, use renderContent. |
I can not see how As far as I understand you wish to evaludate some string, stored in DB, as a view file content. There is no way for it instead of using |
@nineinchnick, can you show an example of how to use this with Twig and not in controller context? Let's say we have |
@klimov-paul, I've created this issue to ask for an ability to use stirng content instead of files in ViewRenderer. I don't like your workaround. |
This is not walk around - this is the only solution. Of course we can instoduce another method in the I suppose for your case a special tool should be used like following: |
@RomeroMsk I think this does not concern Yii at all, you're asking how to process a Twig template. See twig docs. |
@klimov-paul, yes, Mustache is good for this, but it's logic-less. Thanks, anyway. |
@RomeroMsk 你可以这样 |
Stores string in temporary file, renders and returns result using renderPhpFile Related to #6252 #7309
I have something that renders strings stored in SQL adopt it a bit and do your magic edit:// I use it with conjuction with twig strings, because I do not trust others that much |
After thinking, I don't think we should explicitly support that because it will suggest doing that is alright, especially with |
I can't find the way to render a view from string (not from file). I want to use template engine (Twig or Smarty) to render texts from templates stored in DB. For example, store email message template in DB table and generate email body from it on the fly.
The text was updated successfully, but these errors were encountered: