GFPDFHelperHelper_QueryPath

The Gravity PDF GFPDF Helper QueryPath class.

Defined (1)

The class is defined in the following location(s).

/src/helper/Helper_QueryPath.php  
  1. class Helper_QueryPath extends QueryPath { 
  2.  
  3. /** 
  4. * Parse HTML5 documents as strings 
  5. * This uses HTML5-PHP to parse the document. In actuality, this parser does 
  6. * a fine job with pre-HTML5 documents in most cases, though really old HTML 
  7. * (like 2.0) may have some substantial quirks. 
  8. * @param mixed $html 
  9. * A document as a HTML string. 
  10. * @param string $selector 
  11. * A CSS3 selector. 
  12. * @param array $options 
  13. * An associative array of options, which is passed on into HTML5-PHP. Note 
  14. * that the standard QueryPath options may be ignored for this function,  
  15. * since it uses a different parser. 
  16. * @return QueryPath 
  17. * @since 4.0.3 
  18. */ 
  19. public function html5( $html = '', $selector = null, $options = [] ) { 
  20. $html5 = new HTML5(); 
  21. $source = $html5->loadHTML( $html ); 
  22.  
  23. return new DOMQuery( $source, $selector, $options );