Seite 1 von 1

Template Schleifen

Verfasst: 20.05.2005 04:05
von Siegem Metatron
Hallo an alle,

was ich vor habe:
Auf einer Seite soll sich in 3 Teile gliedern.
Einen Header, eine art Body und dann was unten drunter kommt.
Wobei sich der Mitteil Teil variabel wiederholen soll

Teil 1
.
Teil 2
Teil 2
Teil 2
.
Teil 3

Ich benutze das template sys von phpbb.
Aber eine Idee gefällt mir nicht wirklich.

Code: Alles auswählen

	$template->set_filenames(array(
	'head' => 'head.tpl',
	'body' => 'body.tpl',
	'foot' => 'foot.tpl',
	));
....
....
$template->pparse('head');
....
....
	do
	{
		$template->assign_vars(array(
		'DASEINE' => $daseine,
		'DASANDERE' => $dasandere,
		));
	                $template->pparse('body');

	} while ( bedingung );
.....
...
$template->pparse('foot');
Gibt bestimmt bessere Lösungen ? :-?

Vielleicht, hat einer von euch ein Tipp
optimal währe es nur eine *tpl Datei zu verwenden.
Aber bitte keine phpLib Lösungen, das läuft bei mir nicht.
mit dem phpbb Template Sys gehts bestimmt auch

Grüße ;)

Verfasst: 20.05.2005 07:18
von pokepika
nimm halt blöcke.

<!-- BEGIN body -->
{VAR}
<!-- END body>


in php dann per assign_block_vars

Verfasst: 20.05.2005 23:13
von Pyramide
Siehe auch KB:template_syntax