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   1231 Views

Avatar
SunboX

Community Member, 5 Posts

7 June 2009 at 9:15am

Edited: 07/06/2009 9:16am

Hi,

why does this:

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

generate a parse error and this:

<% if ApproveLink || SpamLink %>

does not?

thx Sunny

Avatar
Willr

Forum Moderator, 5513 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