View Single Post

  #4 (permalink)  
Old 05-05-2008
Erwin Moller
 
Posts: n/a
Default Re: How to Escape Ternary Within Here Document?

Michael Ruebner schreef:
> Erwin Moller:
>
>> Only simple variable substituation is done inside a heredoc.

>
> Well, not the answer I was hoping for, but probably to be expected ;-)
> Back to echo-vaganza...
>
> Thanks,
>
> Mike


Hi Mike,

I also suggested:
"So the easiest solution for you probably is: do the ternary statement
before the heredoc, and use its results (in a plain var) inside the
heredoc."

Isn't that an easy way out?
I mean, compared to echo-vaganza a heredoc is much easier to read.
A few $varnames in it helps to keep your HTML code easily readable,
compared to echos.

Anyway, good luck. :-)

Regards,
Erwin Moller
Reply With Quote