All pastes #1303922 Raw Edit

functions / class.template

public php v1 · immutable
#1303922 ·published 2009-01-08 23:41 UTC
rendered paste body
<?php//This file is included by handle.phpclass Template {  var $header;  var $body;  var $footer;  function Template() {       $this->header=$header;    $this->body=$body;    $this->footer=$footer;  }    function Stitch($dir, $file) {    ob_start();    include($dir.$file);    $output = ob_get_contents();    ob_end_clean();    return $output;  }    function Replace($replace, $replacer, $template) {    $output = str_replace($replace, $replacer, $template);    return $output;  }    public function __toString() {    return (string)$this->Replace;  }}?>