home    download    forum    manual    awards    faq    bugs    links

TemplatePower manual




Arabic
Deutsch
Dutch
English
Italian
Portuguese (Brazilian)
Russian
Spanish


* Not fully translated yet.




Looking for the manual in your language? Well, I need translators to translate the manual to any language. So, if you have some sparetime please sign up!

Just email to sign up:
rovel999_AT_codocad_DOT_com

If you have signed up you will receive more information about the translation.

gotoBlock

(unknown)

Move the 'blockpointer' to a block, to make it the currentblock.

Description

gotoBlock ( string blockname )

The function gotoBlock() moves the 'blockpointer' to the block blockname, to make it the currentblock. This is useful when you want to return to a previously made block and assign its variables.

Example 1.
newBlock.tpl
<html>
<head>
  <title>NewBlock</title>
</head>
<body>
<table>
  <tr><td>Names</td></tr>
  <!-- START BLOCK : name_row -->
  <tr>
    <td>{name}</td>
  </tr>
  <!-- END BLOCK : name_row --> 
</table>
<br>
{total_names}
</body>
</html>      

myscript.php
<?php
include_once( "./class.TemplatePower.inc.php" );

$tpl = new TemplatePower( "./newBlock.tpl" );
$tpl->prepare();

$count = 0;

while( $count < 10 )
{
    $tpl->newBlock( "name_row" );
    $tpl->assign( "name", "Ron" );
 
    $count++;
}

$tpl->gotoBlock( "_ROOT" );
$tpl->assign( "total_names", $count );

$tpl->printToScreen();
?>

 

 
CopyRights © 2001-2009 Ron. P.J. Velzeboer.