A teraz problem.
Czytałem ten artykuł
http://php.org.pl/artykuly/3/16
i nie moge sobie poradzić z utworzeniem pliku templates.php stale jakiś błąd mi wyskakuje. Może ktoś mi go napisać poprawnie. A o to co mi wyszło:
php:
<?php /****************************************************************************** * miniTemplate v. 1.2 * Prosta klasa obsługi szablonów oparta na wzorze Splatch'a (splatch@wp.pl) ******************************************************************************/ class template { function template($dir) { if($dir == \"\") { $this -> set_root(\"\"); } else { $this -> set_root($dir); } return true; } function set_root($dir) { if($dir != \"\") { { } else { $this -> root = $dir; } } } function set_files($files) { { } else { { $this -> files[$tpl_id] = $this -> root .\"\". $file; } } } function assign_vars($tpl_id,$values) { { } else { { $this -> template[$tpl_id][tag][$tag] = $value; } } return true; } function assign_var($tpl_id,$tag, $value) { { } $this -> template[$tpl_id][tag][$tag] = $value; return true; } function clear($tpl_id) { } function compile($tpl_id,$code) { { $tag = '{'.$key.'}'; { } } return $code; } function pparse($tpl_id) { { } $file = $this -> files[$tpl_id]; $gcode = $this-> compile($tpl_id,$code); return($gcode); } function parse($tpl_id) { } } ?>
I pokazuje mi ,że z linijką
php:
Kod
unset($this -> template[$tpl_id][tag][]);
(linijka 87)Coś jest nie tak tylko co Question Prosze o pomoc albo napisanie tego pliku z góry thx