witam wszystkich

mam taki mały problem ;/ , napisalem sobie prosta klase do obslugi szablonow ktorej kod widzicie tutaj :
<?php
class template{
private $root;
private $files = array(); private $template = array();
function __construct($root){
$this -> root = $root;
}else{
die('Template : zla sciezka do szablonu !'); }
} // end __construct($root);
function loadFileS($file){
die('Template : funkcja loadFileS przyjmuje tylko tablice !'); }else{
foreach($file as $handle => $FILE){
}else{
die('Template : blad ladowania pliku '.$FILE.'!'); }
}
}
} // end loadFileS($file);
function loadFile($handle, $file){
}else{
die('Template : blad ladowania pliku !'); }
} // end loadFile($file);
function addVars($handle, $values){
die('Templates : funkcja addVars przyjmuje tylko tablice !'); }else{
foreach($values as $tag => $value){
$this -> template[$handle][$tag] = $value;
}
}
} // end addVars($handle, $values);
function addVar($handle, $tag, $value){
$this -> template[$handle][$tag] = $value;
} // end addVars($tag, $value);
function pparse($handle){
if(count($this -> template
[$handle]) > 0
) {
foreach ($keys as $key) {
$this -> files
[$handle] = str_replace($key, $this -> template
[$handle][$key], $this -> files
[$handle]); }
}
return $this -> files[$handle];
} // end parse();
function parse($handle){
print ($this -> pparse
($handle)); } // end parse($handle);
}
?>
natomiast tak wyglada zastosowanie tego w praktyce :
<?php
include ("tpl.class.php");
$tpl = new template("tpl");
'index' => 'index.tpl',
'heder' => 'heder.tpl',
'bottom' => 'bottom.tpl'
));
$tpl -> addVars
('heder', array( '{TITLE}' => 'Spokojnie, to tylko test!',
'{META}' => '',
'{BGCOLOR}' => '#f0f0f0',
'{KODOWANIE}' => 'iso-8859-2'
));
$tpl -> addVars
('bottom', array( '{TEXT}' => 'jakis tam sobie text',
'{TEXT_DWA}' => 'kolejny bzdurny text
' ));
$tpl -> addVars
('index', array( '{HEDER}' => $tpl -> pparse('heder'),
'{TRESC}' => 'Tutaj powinna znajdować się właœciwa treœć strony :)',
'{BOTTOM}' => $tpl -> pparse('bottom')
));
$tpl -> parse('index');
?>
i niby wszytsko jest ok, ale ja bym chcial zrobic taki bajer ze gry zamieniam jakis znacznik z szablonu dajmy na to {TEXT} chcialbym uzyc '{TEXT}' => require('plik.php') no i wlasnie tu jest problem bo zamiast ladnie podminic sformulowanie {TEXT} i wrzucic plik w to miejsce co trzeba to tak nie jest, plik jest includowany od tak sobei na poczatku strony
czy jest jakis sposob zeby cos zty m zrobic
Warsztat :: Windows7 / Ubuntu | PHP 5 | MySQL 5 | Eclipse / NetBeans | Opera / Firefox