v.2.5 Contains function info

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 14, 2013   (RSS)

By In-House-Logic - January 14, 2013

Saw that the new 2.5 release of CMSBuilder sports a "contains" function. Are there any docs or examples of this floating around that I've missed?

Cheers,
J.

By gregThomas - January 14, 2013

Hi J,

There isn't any documentation for this function yet. Here is an example of how you could use it:


$email = 'greg@interactivetools.com';


if(contains('@',$email)){
  echo 'true';
}else{
  echo 'false';
}

The function can be used to check if a string contains another string, and it will return a boolian of true or false

The above function would echo true as the $email string does contain an @ symbol, but if you chaned the $email variable to 'greg' it would return false.

Thanks

Greg

Greg Thomas







PHP Programmer - interactivetools.com

By In-House-Logic - January 14, 2013

Many thanks Greg!  I think this means that this function can not be used to detect whether a mutli-list (checkbox, radiobox, list) pulled from a record in CMSB contains certain values. 
i.e.: a multi-list has had some values checked/present but not others.

Is that correct?

By In-House-Logic - January 14, 2013

Thank you Greg. That's exceptionally helpful. I really appreciate you going through the "what if" process in your response.

Be well!