[phplib] Template vs FastTemplate From: carlos <email protected>
Date: 10/30/00

Hello all.

I'm trying to rewrite all my FastTemplate code in order to use phplib's
template.
First: What is the equivalent code for:

<!--- The template: table.tpl --->
<table>
<!-- BEGIN DYNAMIC BLOCK: row -->
  <tr><td>
    {something}
  </td></tr>
<!-- END DYNAMIC BLOCK: row -->
</table>

<!--- The code: table.php --->
<?php
include("./lib/class.FastTemplate.inc");

$tpl = new FastTemplate(".");

$tpl->define(array(
                 "table" => "tpl/table.tpl",
               ));
$tpl->define_dynamic("row", "table");

for ($i=0; $i<$limit; $i++) {
  $tpl->assign(array("something" => "$i"));
  $tpl->parse("rows", ".row");
}

$tpl->parse("out", "table");
$tpl->FastPrint();

I now it seems easy, but translating all the calls to FastTemplate
functions with calls to phplib's template functions it returns a "rows"
word and not the contents of the "rows" var

Second: Which are the benefits of phplib's template? Can phplib's template
have nested dynamic blocks? Can anybody send me an example?

Thanks!!!!

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>