title: Running PHP Scripts from external file
body: <p>I'm writing a module in my CakePHP application to generate receipts in PDF. The PDF generator takes the "content" as parameters and generates the PDF based on it. So I created a template file that looks like this:</p>
  
  <pre><code>&lt;table&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th colspan="3"&gt;
                      Purchase Summary - Receipt
                      &lt;?php echo "PHP CONTENT ECHO";  ?&gt;
                  &lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
  ...
  </code></pre>
  
  <p>I read the content like this:</p>
  
  <pre><code>$file = file_get_contents('receipt_template', true);
  </code></pre>
  
  <p>I want to pass this content to the PDF generator. When I print the content, none of the  commands are being executed, so the line <code>&lt;?php echo "PHP CONTENT ECHO";  ?&gt;</code> never gets executed. 
  I was thinking to have template file, load the content and just substitute the values, then pass the whole thing to PDF generator to create the PDF document. How can I achieve this?</p>