コード例 #1
0
ファイル: Parser.php プロジェクト: Envalo/APath
 /**
  * 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 '';
 }
コード例 #2
0
ファイル: Engine.php プロジェクト: Envalo/APath
 /**
  * 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);
 }