Smide template ind i templatefil
Hvis jeg har et templatesystem som ligner dette:**
function udskriv() {
ob_start();
include_once( $this->file );
$content = ob_get_contents();
ob_end_clean();
foreach($this->vars as $variable => $value) {
$content = str_replace("\{{$variable}\}", $value, $content);
}
return $content;
}
**
Men hvis jeg nu har et grundlæggende templatesystem som ligner nedenstående der ligger i mappen: "/templates/standard/".
**
<html>
<head>
..
</head>
<body>
{content}
</body>
</html>
**
Men under "/templates/" vil jeg gerne have diverse templatefiler hvor indholdet skal smides ind i min grundlæggende templatefil og byttes ud med "{content}". Hvordan skal det så gøres?
