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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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   2141 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, 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