_startTag = $start; $this->_endTag = $end; return $this; } /** * Return result of getData method for matched variables * * @param array $matches * @return mixed */ protected function _filterDataItem($matches) { return $this->getData($matches[1]); } /** * Insert data to template * * @param string $value * @return string */ public function filter($value) { return preg_replace_callback( '#' . $this->_startTag . '(.*?)' . $this->_endTag . '#', array($this, '_filterDataItem'), $value ); } }