All pastes #895328 Raw Edit

Something

public text v1 · immutable
·published 2008-02-07 18:58 UTC
rendered paste body
- keep in mind i have simplified it + remove unnecessary code

<?php
// Index.php
include('myfile.php');
?>

<?php
// myfile.php
$t = templatesystem;

$t->prekey('content', $t->fetch('includeme.php'));
$t->showcontent('template.tpl');
?>

<?php
// The template system
function fetch($page) {
  ob_start();
  include $page;
  $inc = ob_get_contents();
  ob_en_clean();

  return $inc;
}

function showcontent($template) {
  $f = curl_load($template); 
  foreach($this->template_vars as $r => $w) {
   $load = $this->replace($r, $w, $load);
  }
  $load = preg_replace('{\{(.*?)\}}', '', $load);

  echo $load;
}
?>