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, biapar, Willr, Ingo, swaiba, simon_w

IF statement with multiple OR generates parse error?


Reply

2 Posts   1185 Views

Avatar
SunboX

7 June 2009 at 9:15am (Last edited: 7 June 2009 9:16am), Community Member, 5 Posts

Hi,

why does this:

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

generate a parse error and this:

<% if ApproveLink || SpamLink %>

does not?

thx Sunny

Avatar
Willr

7 June 2009 at 3:27pm Forum Moderator, 5511 Posts

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