Mailinglisten-Archive |
* Ivan Schmid wrote:
> Hat da jemand bereits eine solche Situation gemeistert ohne parser
> Müll im Template B zu haben ?
> --- template A ---
> | --- template B ---
> | Variablen
> || wiederholender Block C
> || ende Block C
> | --- ende template B ---
> --- ende template A ---
A.tpl:
<html><body>
{CONTENT}
</body></html>
B.tpl:
blafasel{TITLE}
<!-- BEGIN foo -->
blablubb {ID}
<!-- END foo -->
PHP Code:
$t->set_file(array(
"main" => "A.tpl",
"CONTENT" => "B.tpl"
));
$t->set_block("CONTENT","foo","fo");
while (schleife) {
$t->set_var(array(
"ID" => $meineidzumbeispielausdatenbank
));
$t->parse("fo","foo",TRUE);
}
$t->pparse("out",array("CONTENT","main"));
--
PHP-Support * realitätsnahe Performance-Messungen mit Code-Analyse
Webapplikationsentwicklung * PHP-Schulungen * Consulting
0700-THINKPHP -*- bjoern_(at)_thinkphp.de
php::bar PHP Wiki - Listenarchive