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.

getVarValue

(unknown)

Returns the value of a variable.

Description

getVarValue ( string [blockname.]variablename )


Note: You are only able to retreive the value of the last instance of a variable. This means that if you have a repeating block, you can only retreive the the variablevalues of the last created block.
Example 1.
number.tpl
<html>
<head>
  <title>AssignInclude Example</title>
</head>
<body>
  <!-- START BLOCK : number -->
    {number}
  <!-- END BLOCK : number -->
  {total}
</body>
</html>

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

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

for( $i=1; $i <= 10; $i++ )
{
 $tpl->newBlock( "number" );
 
 $tpl->assign( "number"     , $i );
 $tpl->assign( "_ROOT.total", ($tpl->getVarValue( "_ROOT.total" ) + $i) );
}

$tpl->printToScreen();
?>

 

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