Page 1 of 1

Heredoc in user-defined tags [solved]

Posted: Wed Apr 29, 2009 6:36 pm
by zims
Hello,

I'm having trouble using the PHP heredoc string syntax inside a user-defined tag. Even the simplest code like below:

Code: Select all

$bar = <<<EOT
bar
EOT;
Produces an error:

Code: Select all

Invalid code entered.
Parse error: syntax error, unexpected $end in /home/directory/website/admin/adduserplugin.php(100) : eval()'d code on line 3
Do UDT's support heredoc? Am I doing anything wrong?

Thanks,

zims

Re: Heredoc in user-defined tags

Posted: Wed Apr 29, 2009 6:41 pm
by calguy1000
heredoc stuff has to be terminated in a newline.

Re: Heredoc in user-defined tags [solved]

Posted: Wed Apr 29, 2009 6:51 pm
by zims
Ah, got it, thanks.

Re: Heredoc in user-defined tags [solved]

Posted: Mon May 04, 2009 1:49 pm
by Riel
I really don't get it :)

Can someone explain? I have a piece of PHP I need to put in, but get this error.
What should I look for?

Re: Heredoc in user-defined tags [solved]

Posted: Mon May 04, 2009 1:53 pm
by Nullig
Look here:

http://wiki.cmsmadesimple.org/index.php ... fined_Tags

Everything you need to know about UDTs.

And here:

http://wiki.cmsmadesimple.org/index.php ... _tags_here

are a bunch of examples.

Nullig