Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

IF statement with multiple OR generates parse error?

Go to End

2 Posts   1772 Views


Community Member, 5 Posts

7 June 2009 at 9:15am

Edited: 07/06/2009 9:16am


why does this:

<% if ApproveLink || SpamLink || HamLink || DeleteLink %>

generate a parse error and this:

<% if ApproveLink || SpamLink  %>

does not?

thx Sunny


Forum Moderator, 5523 Posts

7 June 2009 at 3:27pm

The template engine does not currently support multiple expressions in 1 line. To achieve that you will need to make a wrapper PHP function to do the comparison or separate the or statements into multiple expressions