protected function buildFilter($filterString, array $attrs) { $newAttrs = []; foreach ($attrs as $key => $attrText) { $newKey = '${' . $key . '}'; $newAttrs[$newKey] = $attrText; } return strtr($filterString, $newAttrs); }