Jump to content

SelectableOptionArray::hasValue() - best way to filter multiple values?


DV-JF
 Share

Recommended Posts

Hey,

I'm asking myself, what's the best way to filter a SelectableOptionArray for multiple Values. Is there a better way than doing it like this:

if( $page->optionField->hasValue('foo') || $page->optionField->hasValue('bar') || $page->optionField->hasValue('buzz')) { echo $something };

Any ideas welcome!

Greets!

Link to comment
Share on other sites

Maybe you can do?

$page->optionField->find("value=foo|bar|buzz")

 Not sure what's the property that actually holds the value ? Let me know if it actually works! lol

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...