Heredoc in user-defined tags [solved]

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
zims
Forum Members
Forum Members
Posts: 13
Joined: Mon Mar 24, 2008 8:26 pm

Heredoc in user-defined tags [solved]

Post 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
Last edited by zims on Wed Apr 29, 2009 6:52 pm, edited 1 time in total.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Heredoc in user-defined tags

Post by calguy1000 »

heredoc stuff has to be terminated in a newline.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
zims
Forum Members
Forum Members
Posts: 13
Joined: Mon Mar 24, 2008 8:26 pm

Re: Heredoc in user-defined tags [solved]

Post by zims »

Ah, got it, thanks.
Riel
New Member
New Member
Posts: 9
Joined: Fri May 01, 2009 5:10 pm

Re: Heredoc in user-defined tags [solved]

Post 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?
User avatar
Nullig
Power Poster
Power Poster
Posts: 2380
Joined: Fri Feb 02, 2007 4:31 pm
Location: Comox Valley, BC

Re: Heredoc in user-defined tags [solved]

Post 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
Post Reply

Return to “CMSMS Core”