title: Load PHP code in PHP for delayed + parameterized execution?
body: <p>I have two PHP files:</p>
  
  <blockquote>
    <ul>
    <li>template.php</li>
    <li>template.html.php</li>
    </ul>
  </blockquote>
  
  <p>The first is the class definition for Template. The second contains an actual HTML-based template, however with  PHP constructs (hence the .PHP extension). I'd call this a hybrid html/php file.</p>
  
  <p><strong>Is it possible to create some function in the Template-class (<code>special_include_parse()</code>) which takes a:</strong>  </p>
  
  <ul>
  <li><strong>$path</strong> (to a hybrid html/php file)  </li>
  <li><strong>$model</strong> (which is passed to the code in the hybrid html/php file so that it can be referenced using $this->getModel() or $model or whatever...)</li>
  </ul>
  
  <p><strong>?</strong></p>
  
  <hr>
  
  <p><strong>template.php</strong></p>
  
  <pre><code>class Template {
      function Parse($model) {
          //include('/var/www/template.html.php');
          //fopen('/var/www/template.html.php');
          $return = special_include_parse('/var/www/template.html.php', $model);
      }
  }
  </code></pre>
  
  <p><strong>template.html.php</strong></p>
  
  <pre><code>&lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;&lt;? echo $this-&gt;getModel()-&gt;getTitle(); ?&gt;&lt;/title&gt;
      &lt;/head&gt;
  &lt;/html&gt;
  </code></pre>