Jump to:

21309 Posts in 5738 Topics by 2603 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, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 961 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
    5175 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

    961 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.