Post
#1
|
|
|
Grupa: Zarejestrowani Postów: 66 Pomógł: 0 Dołączył: 22.03.2008 Skąd: Janów Lubelski Ostrzeżenie: (0%)
|
Witam zastanawiam sie czym sie rozni klasa templatowa napisana w php od biblioteki smarty.
Mam taki kod : <?php class cTemplate { var $assign; // .... html ... {$cos} ... {$jakisinny} var $parsed; function parse ($_file_name) { if (!file_exists($_file_name)) { echo "Nie znaleziono pliku: ".$_file_name; return 0; } $this->parsed = file_get_contents($_file_name, 500000); $i = 0; if (isset($this->assign)) { foreach ($this->assign as $key => $value) { $source[$i] = "{\{:content:}quot;.$key."}"; $destination[$i] = $value; $i++; } } if (!isset($source)) return $this->parsed; return $this->parsed = str_replace($source, $destination, $this->parsed); } } ?> czym on sie rozni od smarty? czy smarty posiada jakies dodatkowe ciekawe przydatne funkcje? Ten post edytował endr1u 22.01.2009, 22:12:40 |
|
|
|
![]() |
Post
#2
|
|
|
Grupa: Zarejestrowani Postów: 662 Pomógł: 45 Dołączył: 26.03.2007 Skąd: Warszawa Ostrzeżenie: (0%)
|
No padnem zaraz (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) Zapraszam do dokumentacji smartów (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
http://smarty.net/manual/en/ ps. No i zły dział (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) Ten post edytował Moli 22.01.2009, 22:14:49 |
|
|
|
endr1u Klasa templatowa a SMARTY 22.01.2009, 22:11:47
EarthCitizen ... ... ... ... dobrze, że twardo siedzę a tak na... 22.01.2009, 22:14:53
endr1u Cytat(EarthCitizen @ 22.01.2009, 22:14... 22.01.2009, 22:18:27 ![]() ![]() |
|
Aktualny czas: 26.12.2025 - 07:22 |