format

The Gravity PDF format function.

Description

format( (QueryPath) $qp, (constant) $findSelector = null ); 

Parameters (2)

0. $qp (QueryPath)
The qp.
1. $findselector (constant)
The findselector.

Usage

  1. if ( !function_exists( 'format' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'gravity-pdf/vendor/querypath/querypath/examples/docx.php'; 
  3.  
  4. // The qp. 
  5. $qp = null; 
  6.  
  7. // The findselector. 
  8. $findselector = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = format($qp, $findselector); 
  12.  

Defined (1)

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

/vendor/querypath/querypath/examples/docx.php  
  1. function format($qp, $findSelector = null) { 
  2.  
  3. // Create a new branch for printing later. 
  4. $qr = $qp->branch(); 
  5.  
  6. $text = ""; 
  7.  
  8. $text = $qr->find($findSelector)->find('w|t')->text(); 
  9.  
  10. $text = (checkUnderline($qp->branch())) ? '<u>'.$text.'</u>' : $text; 
  11. $text = (checkBold($qp->branch())) ? '<b>'.$text.'</b>' : $text; 
  12.  
  13. return $text;