Mailinglisten-Archive |
hi,
ich habe ein Template mit einem dynamischen Block, das ungefähr so
aussieht:
<!-- xyz.tpl -->
<html>
<body>
<select>
<!-- BEGIN DYNAMIC BLOCK: sub_sub_art_sel_entry -->
<option value="{sub_pid}">{sub_pname}
<!-- END DYNAMIC BLOCK: sub_sub_art_sel_entry -->
</select>
Mit folgenden Befehlen erstelle ich die Ausgabe:
$tpl = new FastTemplate(".");
$tpl->define(array(page => "xyz.tpl"));
$tpl->define_dynamic("sub_sub_art_sel_entry","page");
while($buffer = array_shift($struktur_child)){
$tpl->assign(sub_pid,$buffer[0]);
$tpl->assign(sub_pname,$buffer[1]);
}
$tpl->parse(FINAL,"page");
$tpl->FastPrint(FINAL);
Nun tritt das Problem auf, daß nur der letzte Eintrag des Dynamische
Blocks auf der Seite erscheint.
Verwende ich folgenden Code:
$tpl = new FastTemplate(".");
$tpl->define(array(page => "xyz.tpl"));
$tpl->define_dynamic("sub_sub_art_sel_entry","page");
while($buffer = array_shift($struktur_child)){
$tpl->assign(sub_pid,$buffer[0]);
$tpl->assign(sub_pname,$buffer[1]);
$tpl->parse(SUBS,".sub_sub_art_sel_entry");
}
$tpl->parse(FINAL,"page");
$tpl->FastPrint(FINAL);
wird statt "<option ...>" einmalig "SUBS" in die Seite eingebunden.
Wo liegt mein Fehler?!?
lamp, mod_php 4.0.1pl2
danke
Martin Abraham
php::bar PHP Wiki - Listenarchive