title: dompdf: templates & $_SESSION variables
body: <p>i was wondering if this setup would work.  i have to crank out a batch of PDF from a bunch of variables i'm pushing into the $_SESSION via a form (duh...).  the idea is to pass the template file to the dompdf engine and have the template populate from the $_SESSION then out to PDF.  it seems to me that when the $template gets loaded it should do that, yes?</p>
  
  <p>here's the basic code:</p>
  
  <pre><code>&lt;?php
  function renderToPDF($theTemplate = "template.php") // this is just to show the value
  {
    require_once("dompdf/dompdf_config.inc.php");
  
    $content = file_get_contents($theTemplate); 
  
    if ($content !== false)
    {
      $dompdf = new DOMPDF();
      $dompdf-&gt;load_html($content);
      $dompdf-&gt;render();
      $dompdf-&gt;stream("kapow_ItWorks.pdf");
    }
  }
  ?&gt;
  </code></pre>
  
  <p>and this is the <code>template.php</code> file (basically... you don't want all 16 pages...)</p>
  
  <pre><code>&lt;html&gt;
  &lt;meta&gt;
  &lt;head&gt;
    &lt;link href="thisPage.css" type="text/css" rel="stylesheet"&gt;
  &lt;/head&gt;
    &lt;body&gt;
      &lt;h1&gt;&lt;?php echo $_SESSION['someTitle'] ?&gt;&lt;/h1&gt;
      &lt;h2&gt;wouldn't it be nice, &lt;?php echo $_SESSION['someName'] ?&gt;&lt;/h2&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>so my thinking is that the template.php will pull the variables right out of the <code>$_SESSION</code> array without any intervention, looking like this:</p>
  
  <h1>BIG TITLE</h1>
  
  <h2>wouldn't it be nice, HandsomeLulu?</h2>
  
  <p>i guess the nut of the question is: Do <code>$_SESSION</code> variables get evaluated when PHP files are loaded, but not rendered?</p>
  
  <p>WR!</p>