<? include (\"parser.php\"); $tpl = new template; $tpl -> load(index.tpl); \"TYTOL\" => \"Moja pierwsza strona z szablonami\", \"MENU\" => \"DUPA\", \"TRESC\" => \"hohohoho dziala:)\" ); $tpl->parse(); ?>
index.tpl
<?php <html> <head> <TITLE>{TYTOL}</TITLE> </head> <body> <table> <tr><td>{MENU}</td><td>{TRESC}</td></tr> <table> </body> </html> ?>
parser.php
<? class template { var $parsed = ''; function load($plik) { } function parse() { $this -> parsed = \"\"; for($i = 0; $i <= $cnt; $i++) { $tekst = $this -> unparsed[$i]; { foreach($found[1] as $block) { $block_names[] = '{'.$block.'}'; $block_values[] = &$this -> blocks[$block]; } } $this -> parsed .= $tekst; } } } ?>
Moja glupota... juz dziala ;/