Hi,
i have two PHP files:
- template.php
- template.html.php
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.
Is it possible to create some function in the Template-class (special_include_parse()
) which takes a:
- $path (to a hybrid html/php file)
- $model (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...)
?
template.php
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);
}
}
template.html.php
<html>
<head>
<title><? echo $this->getModel()->getTitle(); ?></title>
</head>
</html>