
Z kolegą napisałem system templatkowy :
<? include("config.php"); class template { function load_file($template, $file) { { } else { } return $result; } function make_arg($file, $whatreplace, $result) { return $result; } } { $template=new template(); if ($templates == 1) { $main_template=$template->load_file("1", "index"); } elseif ( $templates == 2) { $main_template=$template->load_file("2", "index"); } elseif ( $templates == 3) { $main_template=$template->load_file("error", "index"); } { $main_template=$template->make_arg($main_template, "login", "To jest logowanie"); } $main_template=$template->make_arg($main_template, "login1", "To jest logowanie1"); { $main_template=$template->make_arg($main_template, "test", $test); } } ?>
Działa to tak że w ./templates/nazwa_templatki/index.html mam ogólną stronkę tylko w html .
Kod php lub jakieś działanie umieszczamy w :
<!--nazwa-->
Tutaj:
<?php $main_template=$template->make_arg($main_template, "login1", "To jest logowanie1"); ?>
Mamy tak: login1 to nazwa tego: <!--login1--> , a To jest logowanie to jest to co się wyświetla ;-) .
Opisuje to wszystko ponieważ mam problem .
Chciałbym umieścić w zmiennej $baza kod PHP! z pliku /includes/baza.php .
Próbowałem na różne sposoby lecz robi to tak że Jak dam kod naprzykład:
<?php ?>
To nie odczytuje tego na stronie

Proszę o pomoc z tym ;-) .
A drugie to :
Zauważyłem że w paru skryptach użyte jest /n lub /t . Co znaczy /t ? I czy jest tego więcej?
Proszę o pomoc i przepraszam za literówki ;-) .