I'm using Kohana to create an e-mail view which is entirely plain text as a part of a MIME Multipart/alternative e-mail. Since plaintext does not really allow for formatting, I want to be able to use interpolated strings to allow escaped characters so I can create new lines, tabs, etc.
However, using Kohana's built in method for rendering a view:
View::factory('view_file')->render()
always gives me what I believe is a string literal. If I simply create a interpolated string on my own, the escaped characters are created. Using the above method, however, always gives me a literal string so escape codes like \r
\t
\n
appear literally the same in the body of the e-mail.
Is there some way for me to convert the entire string returned by the render()
method so that it's an interpolated string in PHP?
The reason I want to do this is because I'm using separate views for the HTML and plaintext versions of the e-mail templates, and I want to stick to this convention while being able to use escaped characters in the plaintext version for minimal formatting purposes.
I have already tried embedding the output of the render method into a interpolated string like $view = "$view"
, but it's my understanding the string gets created and set as it is being made, regardless of whether it's interpolated or literal.