Re: [Phplib-users] Template.inc
Brought to you by:
nhruby,
richardarcher
|
From: Layne W. <la...@if...> - 2001-09-10 14:50:47
|
> i need to use this kind of block in a template
>
> <!-- BEGIN MENU -->
> <tr>
> <td><a href="{NAME_MENU}"><img src="{IMG_MENU}"></a>
> </tr>
> <!-- BEGIN SUB_MENU -->
> <tr>
> <td><a href="{NAME_SUB_MENU}"><img src="{IMG_SUB_MENU}"></a>
> </tr>
> <!-- END SUB_MENU -->
> <!--END MENU -->
$tpl = new Template("../templates/");
$tpl->set_file("example", "example.tpl");
$tpl->set_block("example", "MENU");
$tpl->set_block("MENU", "SUB_MENU", "SUB_MENUS");
while( some loop that sets your variables ) {
$tpl->set_var(array("NAME_SUB_MENU" => $name_sub_menu, "IMG_SUB_MENU" =>
$img_sub_menu));
$tpl->parse("SUB_MENUS", "SUB_MENU", true);
}
$tpl->pparse("example", array("MENU"));
Layne Weathers
Ifworld Inc
|