Skip to content

Contains helper accepts objects

Compare
Choose a tag to compare
@villesiltala villesiltala released this 07 Oct 16:23
· 408 commits to master since this release

The Contains helper can now handle both arrays and objects.

contains is a conditional helper. It can be used to determine if an array/object contains a wanted item, so it works like PHP's in_array. It can also have an else condition.

Example:

{@contains key=haystack value="needle"}
  Found it! :)
{:else}
  Didn't find it. :(
{/contains}