private function _replace_label($full_match, $opening_tag, $label_inner, $closing_tag, $template) { $OpeningTag = new PerchXMLTag($opening_tag); $attrs = array(); $attrs['id'] = $OpeningTag->id(); $attrs['class'] = $OpeningTag->class(); $attrs['for'] = $this->field_prefix . $OpeningTag->for(); $new_opening_tag = PerchXMLTag::create('label', 'opening', $attrs); $template = str_replace($opening_tag, $new_opening_tag, $template); $new_closing_tag = PerchXMLTag::create('label', 'closing'); $template = str_replace($closing_tag, $new_closing_tag, $template); return $template; }