phpbar.de logo

Mailinglisten-Archive

[php] PHPLib Templates Verschachtelungen

[php] PHPLib Templates Verschachtelungen

Ivan Schmid php_(at)_phpcenter.de
Tue, 21 May 2002 11:24:35 +0200


---------------------------
Problem:
---------------------------
Variable {bb} im Template B wird nicht geparst !!
Frage: Was mach ich bloss falsch ? Habe alle möglichen Kombinationen
schon ausgenutzt.

---------------------------
Template Szenario:
---------------------------
--------- Template A ---------
  [[[ --------- Template B --------- ]]]
      Text und Variablen {bb}
  [[[ --------- Template B --------- ]]]

  [[[ --------- Template C ---------
       Text und Variable {cc}
  [[[ --------- Repetierender Block C1---------]]]
  [[[ --------- Ende Block C1---------]]]
  [[[ --------- Template C ---------
--------- Template A ---------


---------------------------
Code:
---------------------------

$template->set_file(array(
    INDEX  => "A.tpl",
    MENU  => "B.tpl",
    CONTENT => "C.tpl"
  ));

$template->set_block("CONTENT", "C1", "handle");
  while($db->next_record())
   {
    $template->set_var(array( blabla    => $db->f("id"),  ));
    $template->parse("handle","C1", true);
    };

$template->set_var(array(
   bb  => "Menuliste"
 ));

$template->pparse("OUT",array("CONTENT", "MENU", "INDEX"));

---------------------------


Mit freundlichen Grüssen,
Ivan


php::bar PHP Wiki   -   Listenarchive