/** * This is used as a callback for preg_replace_callback * The regex that triggers it looks for $$$(some number)%%% in the string. * We return an empty string because we want to remove that, but we also instantiate * a new parser to parse what was originally in that location. * @param $matches array * @return string */ protected function _processFilters($matches) { $filter_index = (int) $matches[1]; $filter = $this->_filters[$filter_index]; $parser = new Envalo_APath_Parser(); $this->_current_node->addFilter($parser->parse($filter)); return ''; }
/** * Parse an APath type path into a set of Envalo_APath_Node objects * @param $path * @return array */ protected function _parse($path) { $parser = new Envalo_APath_Parser(); return $parser->parse($path); }