mam taki system szablonów:
<?php
class simpleTemplate {
var $toChange;
var $str;
function simpleTemplate()
{
$this -> toChange
= array(); $this -> str = '';
}
function setTemplate($ATemplate)
{
$this -> str = $ATemplate;
}
function loadFromFile($AFileName)
{
}
function addChange($AKey, $AValue)
{
$this -> toChange[$AKey] = $AValue;
}
function executeChanges()
{
if (count($this -> toChange
) > 0
) {
foreach ($tmpKeys as $currentKey) {
$this -> toChange[$currentKey],
$this -> str);
}
}
return $this -> str;
}
}
?>
szablon.tpl:
{content}
index.php:
<?php
nclude_once('parser.php');
$st = new simpleTemplate();
$st -> loadFromFile('szablon.tpl');
$st -> addChange('{title}', "Tytuł");
$st -> addChange('{content}', "INCLUDOWANIE");
echo $st -> executeChanges
(); ?>
własciwie wszystko jest ok tylko mam problem jezeli tam gdzie mam {content} chciałbym zaincludować plik (zeby zamiast {content} pojawiło sie <? include("content.php"); ?>