Recommend this page to a friend! |
Fast Template | > | All threads | > | bug | > | (Un) Subscribe thread alerts |
|
Favian Medina - 2007-07-23 23:19:27
Dear friend:
I want to get this result <!-- NAME: main.html --> <html> <head><title>FastTemplate Test</title> </head> <body> <!-- NAME: table2.html --> <table> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 01/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">3</div></td> <td><div align="center"> 8:03 </div></td> <td><div align="center">3000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">3</div></td> <td><div align="center"> 8:03 </div></td> <td><div align="center">3000</div></td> </tr> <!-- END: row_group.html --> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 02/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">3</div></td> <td><div align="center"> 8:03 </div></td> <td><div align="center">3000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row.html --> <!-- NAME: row.html --> <tr> <td><div align="center">3</div></td> <td><div align="center"> 8:03 </div></td> <td><div align="center">3000</div></td> </tr> <!-- END: row.html --> <!-- END: row_group.html --> </table> <!-- END: table2.html --> </body> </html> <!-- END: main.html --> AND I HAVE THIS FILES //////////////////////////////////////////////////////////////////////// <?php include("cls_fast_template.php"); $tpl = new FastTemplate("./"); $tpl->define( array( main => "main3.html", table => "table3.html", group => "row_group.html", row_det => "row3.html" )); $tpl->assign(TITLE,"FastTemplate Test"); for ($m=1; $m <= 2; $m++) { $tpl->assign(VAL_FECHA," 0$m/07/2007 "); for ($n=1; $n <= 3; $n++) { $BigNum = " 8:0$n "; $edif=$n*1000; $tpl->assign( array( VAL_NO => $n, VAL_HORA => $BigNum, VAL_EDIF => $edif)); $tpl->parse(ROWS,".row_det"); }//fin for ($n=1; $n <= 3; $n++) { $tpl->parse(ROW_GROUP,".group"); //$tpl->parse(ROW_GROUP, array("row_det",".group")); }//fin for ($m=1; $m <= 2; $n++) { // $var1="este es el valor a ver.."; $tpl->assign(var10,$var1); $tpl->parse(MAIN, array("table","main")); Header("Content-type: text/plain"); $tpl->FastPrint(); //$tpl->showDebugInfo(1); exit; ?> **************************************************************** HTML <!-- NAME: main3.html --> <html> <head><title>{TITLE}</title> </head> <body> {MAIN} </body> </html> <!-- END: main3.html --> ****************************************************************** <!-- NAME: table3.html --> <table> {ROW_GROUP} </table> <!-- END: table3.html --> ******************************************************************** <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha {VAL_FECHA} </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> {ROWS} <!-- END: row_group.html --> ************************************************************************ <!-- NAME: row3.html --> <tr> <td><div align="center">{VAL_NO}</div></td> <td><div align="center">{VAL_HORA}</div></td> <td><div align="center">{VAL_EDIF}</div></td> </tr> <!-- END: row3.html --> I' DON'T UNDERSTAND WHY I CAN'T GET THE RESULT... I'M WRONG OR THIS IS A BUG PLEASE HELP ME MY FRIEND
Favian Medina - 2007-07-24 00:13:17 - In reply to message 1 from Favian Medina
I WAS WRONG !!!1
I JUST NEEDED TO CLEAR THE VARIABLE TO OBTAIN MY RESULT <!-- NAME: main3.html --> <html> <head><title>FastTemplate Test</title> </head> <body> <table> <!-- NAME: table3.html --> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 01/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row3.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row3.html --> <!-- NAME: row3.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row3.html --> <!-- END: row_group.html --> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 02/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row3.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row3.html --> <!-- NAME: row3.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row3.html --> <!-- END: row_group.html --> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 03/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row3.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row3.html --> <!-- NAME: row3.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row3.html --> <!-- END: row_group.html --> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 04/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row3.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row3.html --> <!-- NAME: row3.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row3.html --> <!-- END: row_group.html --> <!-- NAME: row_group.html --> <tr> <td colspan="3">Fecha 05/07/2007 </td> </tr> <tr> <td><div align="center">No </div></td> <td> <div align="center">Hora</div> </td> <td><div align="center">Edificio</div></td> </tr> <!-- NAME: row3.html --> <tr> <td><div align="center">1</div></td> <td><div align="center"> 8:01 </div></td> <td><div align="center">1000</div></td> </tr> <!-- END: row3.html --> <!-- NAME: row3.html --> <tr> <td><div align="center">2</div></td> <td><div align="center"> 8:02 </div></td> <td><div align="center">2000</div></td> </tr> <!-- END: row3.html --> <!-- END: row_group.html --> <!-- END: table3.html --> </table> </body> </html> <!-- END: main3.html --> ************************************************************* <?php include("cls_fast_template.php"); $tpl = new FastTemplate("./"); $tpl->define( array( main => "main3.html", table => "table3.html", group => "row_group.html", row_det => "row3.html" )); $tpl->assign(TITLE,"FastTemplate Test"); for ($m=1; $m <= 5; $m++) { $tpl->assign(VAL_FECHA," 0$m/07/2007 "); //$tpl->assign(ROWS,""); $tpl->clear(ROWS); //$tpl->assign(ROWS,""); for ($n=1; $n <= 2; $n++) { $BigNum = " 8:0$n "; $edif=$n*1000; $tpl->assign( array( VAL_NO => $n, VAL_HORA => $BigNum, VAL_EDIF => $edif)); $tpl->parse(ROWS,".row_det"); }//fin for ($n=1; $n <= 3; $n++) { //$tpl->parse(ROW_GROUP, array("row_det","group")); $tpl->parse(ROW_GROUP,".group"); //$tpl->parse(ROW_GROUP, array("group","row_det")); }//fin for ($m=1; $m <= 2; $n++) { // $var1="este es el valor a ver.."; $tpl->assign(var10,$var1); $tpl->parse(MAIN, array("table","main")); Header("Content-type: text/plain"); $tpl->FastPrint(); $tpl->showDebugInfo(1); exit; ?>
Valics Lehel - 2007-07-24 14:49:18 - In reply to message 1 from Favian Medina
Can you specify a little bit more what do you want to do?
I saw there dynamic zone issue with no dynamic tags and parsing where should be assign... That is why it would be better if you could explain further. th |
info at phpclasses dot org
.