Skip to content

Commit

Permalink
Merge pull request FluidTYPO3#751 from Momodedf/development
Browse files Browse the repository at this point in the history
[FEATURE] Filter by array in iterator.filter
  • Loading branch information
NamelessCoder committed Feb 27, 2015
2 parents 75a590d + 27ddeb9 commit 60a30bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Classes/ViewHelpers/Iterator/FilterViewHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function render($subject = NULL, $filter = NULL, $propertyName = NULL, $p
* simply does a weak comparison (==) for sameness.
*
* @param mixed $item
* @param mixed $filter
* @param mixed $filter Could be a single value or an Array. If so the function returns TRUE when $item matches with any value in it.
* @param string $propertyName
* @return boolean
*/
Expand All @@ -78,7 +78,7 @@ protected function filter($item, $filter, $propertyName) {
} else {
$value = $item;
}
return ($value == $filter);
return is_array($filter) ? in_array($value, $filter) : ($value == $filter);
}

}

0 comments on commit 60a30bd

Please sign in to comment.