title: How to get page number on dompdf PDF when using "view"
body: <p>Ok, so I use the following snippet to get "views" of HTML with PHP variables loaded in as <code>$data</code> so that I can do things like fill in <code>tr</code>'s of data from a database call or whatever.</p>
  
  <pre><code>function getView ($file, $data=NULL) {
      if (!empty($data)) extract($data);
      ob_start();
      if (is_file($file)) include($file);
      return ob_get_clean();
  }
  </code></pre>
  
  <p>Gets used for something like, <code>$htmlPDF = getView('receipt.php', array( 'orderNumber' =&gt; $orderNumber ));</code> Where <code>$orderNumber</code> is then used in the HTML to fill in it's proper places. For instance something like:</p>
  
  <pre><code>&lt;h1&gt;You Order #&lt;?= $orderNumber; ?&gt;&lt;/h1&gt;
  </code></pre>
  
  <p><hr />
  Ok, so point is, that's how I get my HTML. I then load it to my dompdf variable as:</p>
  
  <pre><code>$dompdf = new DOMPDF();
  $dompdf-&gt;load_html($html);
  $dompdf-&gt;render();
  </code></pre>
  
  <p>Which all works great. The problem is getting the <code>inline php</code> script to work to get PAge Numbers / Page Headers|Footers. I've followed the directions <a href="https://code.google.com/p/dompdf/wiki/FAQ#wikicontent" rel="noreferrer">here</a> best I can, but I can't seem to make the right blend. Thus far, not having any errors, except I get <b>0</b> Page Numbers anywhere!</p>
  
  <p>And yes I've looked at pages like <a href="https://stackoverflow.com/questions/7484318/header-in-pdf-page-using-dompdf-in-php">Header in PDF page using DOMPDF in PHP</a> and <a href="https://stackoverflow.com/questions/13159645/dompdf-page-number">dompdf page number</a>, but still no forward progress, at all! I'm wondering if the <code>inline php</code> scripting has to do with how I'm getting the HTML as a string?  Any pointers, ideas, advice?</p>