xterminator wrote:
> On Monday 21 February 2005 19:59, Ciprian Zaharie wrote:
> [snip]
>
>>>>>who writes something like
>>>>>echo "
>>>>echo " style=\"";
>>>>>echo $variable;
>>>>>echo "\">\n";
>>>>>
>>>>>
>>>>>>>or the same in one line
>>>>>
>
> I don't recommend coding php that way for numberous reasons. Writing code
> that way is like how windows is build -- a pile of garbage ...
>
> You can make use of the DOCHERE structure which is also recognised in Quanta
>
> try this:
> echo <<
> You can put basically anything in here and the variables will get
> parsed as well.
>
> See http://www.php.net/docs/ for more info. Look for the DOCHERE syntax
>
> MYECHO;
> ?>
> The column afterwards is the only supported character besides the DOCHERE
> terminator on that line.
>
> With kind regards
>
>
> Andy
Just as a quick FYI, you can't put ANY variable in a dochere. The same
limitations apply to it as to double quoted strings (" not '). Arrays
will give you problems. Like:
echo <<test
This does not work.
MYECHO;
However, all you have to do is wrap your variables in {} and they work fine:
echo <<test
This does work.
MYECHO;
I'd also like to take this time to add that I think it'd be REALLY nice
to have quanta do auto-completion, etc inside a heredoc. Basically
treating it like regular HTML/XHTML.
It's not a huge problem though, because I just make everything OUTSIDE
of my php (often in another doc called temp.html or something), and then
copy/paste it into the heredoc.
--
Aaron D. Campbell
IT Manager
Auto Transport Team
_______________________________________________
Quanta mailing list
Quanta@mail.kde.org
https://mail.kde.org/mailman/listinfo/quanta | |