28 function smarty_modifier_filter($objects, $attribute, $regex, $invert=
false) {
29 return array_filter($objects,
function($obj) use ($attribute, $regex, $invert) {
30 $match = preg_match($regex, $obj->getValue($attribute));
31 return $invert ? !$match : $match;