Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Klasa templatowa a SMARTY
endr1u
post
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
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 25.12.2025 - 09:39