add fetch_string function so templates can live in a database table as well

This commit is contained in:
Pim Snel 2005-07-01 13:27:35 +00:00
parent f9ec4bcae0
commit cd8871a53d

View File

@ -197,5 +197,16 @@
echo "<strong>Backtrace</strong>: ".function_backtrace(2)."<br/>\n"; echo "<strong>Backtrace</strong>: ".function_backtrace(2)."<br/>\n";
} }
function fetch_string($string)
{
$tmpfname = tempnam ("/tmp", "sav");
$fp = fopen($tmpfname, "w");
fwrite($fp, $string);
fclose($fp);
$this->addPath('template','/tmp');
$file_arr= explode('/',$tmpfname);
return $this->fetch($file_arr[2]);
unlink($tmpfname);
}
} }