Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Parser, includowanie
Gibcio
post 23.06.2007, 15:26:45
Post #1





Grupa: Zarejestrowani
Postów: 48
Pomógł: 0
Dołączył: 20.04.2005

Ostrzeżenie: (0%)
-----


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.
Go to the top of the page
+Quote Post

Posty w temacie
- Gibcio   [PHP] Parser   23.06.2007, 15:26:45


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 12:55