Mam sobie taki parser
  1. <?
  2. class Template
  3. {
  4. var $tmpl;
  5. var $dane;
  6.  
  7. function Template ($name)
  8. {
  9. $this->tmpl = implode('', file($name));
  10. $this->dane = Array();
  11. }
  12.  
  13. function dodaj($name, $value = '')
  14. {
  15. if (is_array($name))
  16. {
  17.  $this->dane = array_merge($this->dane, $name);
  18. }
  19. else if (!empty($value))
  20. {
  21.  $this->dane[$name] = $value;
  22. }
  23. if($value == "include")
  24. {
  25.  $this->dane = "include($plik)";
  26. }
  27. }
  28.  
  29. function pokaz()
  30. {
  31. return preg_replace('/{([^}]+)}/e', '$this->dane["1"]', $this->tmpl);
  32. }
  33. }
  34. ?>


i chciałbym zastosować w pliku index.php includowanie ale nie wiem w jakiej postaci to napisać - proszę o pomoc.