Jump to:

23364 Posts in 18125 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » IF statement with multiple OR generates parse error?

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

Page: 1
Go to End
Author Topic: 1161 Views
  • SunboX
    Avatar
    Community Member
    5 Posts

    IF statement with multiple OR generates parse error? Link to this post

    Hi,

    why does this:

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

    generate a parse error and this:

    <% if ApproveLink || SpamLink %>

    does not?

    thx Sunny

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: IF statement with multiple OR generates parse error? Link to this post

    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

    1161 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.