Location: PHPKode > scripts > Template Engine > template-engine/doc_en.htm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Template engine documentation</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<link href="tables.css" rel="stylesheet" type="text/css">
</head>

<body>
<p><strong>Methods</strong></p>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin">php</td>
    <td class="metod_title_main"><strong>tpleng (</strong> [<font color="#004080">string</font> 
      <strong>$root</strong> [, <font color="#004080">string</font> <strong>$empty</strong>]] 
      <strong>)</strong></td>
  </tr>
  <tr>
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">root</font> ( 
        default: './' ) - root directory of templates</p>
      <p><font color="#000000">empty</font> ( default: 'empty' ) - defines how uknown handles should be replaced if not declared</p>
      <p class="metod_values">'empty' - remove<br>
        'none' - keep<br>
        'comment' - comment<br>
        'space' - change into &amp;nbsp;</p>
      </td>
  </tr>
</table>
<br>
<table width="200" border="0" cellspacing="0" cellpadding="0" class="sample_table">
  <tr>
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">Template Engine initialization</td>
  </tr>
  <tr>
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
	<code><font color="#000000">
	<font color="#007700">require_once(</font><font color="#DD0000">'./tpleng.class.php'</font><font color="#007700">);
	<br /></font><font color="#0000BB">$tpleng </font><font color="#007700">= new </font><font color="#0000BB">tpleng</font><font color="#007700">(</font><font color="#DD0000">'templates/'</font><font color="#007700">, </font><font color="#DD0000">'comment'</font><font color="#007700">);</font>
	</font></code>
	</td>
  </tr>
</table>
<br>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin"> php</td>
    <td class="metod_title_main"><strong>set_file (</strong> <font color="#004080">string</font> 
      <strong>$var_name</strong>, <font color="#004080">string</font> <strong>$file_name 
      )</strong></td>
  </tr>
  <tr> 
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">var_name</font> 
        - var's handle which should be assigned to</p>
      <p><font color="#000000">file_name</font> - file name</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellspacing="0" cellpadding="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">main template file</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
	<p><code><font color="#000000"> <font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_file</font><font color="#007700">(</font><font color="#DD0000">'template'</font><font color="#007700">, 
        </font><font color="#DD0000">'template.htm'</font><font color="#007700">);</font> 
        </font></code></p>
      <p>sets main template file</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">files only with blocks</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
	<p><code><font color="#000000"> <font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_file</font><font color="#007700">(</font><font color="#DD0000">'temporary'</font><font color="#007700">, 
        </font><font color="#DD0000">'blocks1.htm'</font><font color="#007700">); 
        <br />
        </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_file</font><font color="#007700">(</font><font color="#DD0000">'temporary'</font><font color="#007700">, 
        </font><font color="#DD0000">'blocks2.htm'</font><font color="#007700">);</font> 
        </font></code></p>
      <p>sets file with blocks. If the file contains only block those files may 
        be assigned on the same handle.</p></td>
  </tr>
</table>
<br>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin"> php</td>
    <td class="metod_title_main"><strong>set_var (</strong> <font color="#004080">string</font> 
      <strong>$var_name</strong>, <font color="#004080">string</font> <strong>$var_value 
      )</strong></td>
  </tr>
  <tr> 
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">var_name</font> 
        - var's handle which should be assigned to</p>
      <p><font color="#000000">var_value</font> - handle's value</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">simple handle</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
	<p><code><font color="#000000"> <font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_var</font><font color="#007700">(</font><font color="#DD0000">'name'</font><font color="#007700">, 
        </font><font color="#DD0000">'Bart'</font><font color="#007700">);</font> 
        </font></code></p>
      <p>assign simple handle</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">simple handle</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"><p><code><font color='#000000'><font color='#FF9000'>{name}</font> 
        </font></code></p>
      <p>handles must be written between braceleft ('{') and braceright ('}')</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">handle-array</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
    	<p>data could be array as well</p>
	<p><code><font color="#000000"> <font color="#0000BB">$person</font><font color="#007700">= 
        array( <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'name' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'Bart'</font><font color="#007700">, 
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'surname' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'Simpson'</font><font color="#007700">, 
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'passports' 
        </font><font color="#007700">=&gt; array(<br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'code' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'666'</font><font color="#007700">, 
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'serialno' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'999'</font><font color="#007700">)); 
        <br />
        </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_var</font><font color="#007700">(</font><font color="#DD0000">'persons'</font><font color="#007700">, 
        </font><font color="#0000BB">$person</font><font color="#007700">);</font> 
        </font></code></p>
      </td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">handle-array</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"><p><code><font color='#000000'><font color='#FF9000'>{persons.name}, 
        {persons.surname}, {persons.passports.code}, {persons.passports.serialno}</font></font></code></p>
      <p>handle-array's must be declared the same as simple handles but handle 
        and subhandle should be separated with dot.</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">ifset tag</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <p>first example</p>
      <p><code><font color="#000000"><font color="#0000BB">$person</font><font color="#007700">= 
        array( <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'name' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'Bart'</font><font color="#007700">, 
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'surname' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'Simpson'</font><font color="#007700">, 
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'email' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'hide@address.com'</font><font color="#007700">); 
        <br />
        </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_var</font><font color="#007700">(</font><font color="#DD0000">'persons'</font><font color="#007700">, 
        </font><font color="#0000BB">$person</font><font color="#007700">);</font> 
        </font></code></p>
      <p>second example</p>
      <p><code><font color="#000000"><font color="#0000BB">$person</font><font color="#007700">= 
        array( <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'name' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'Bart'</font><font color="#007700">, 
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'name' 
        </font><font color="#007700">=&gt; </font><font color="#DD0000">'Simpson'</font><font color="#007700">); 
        <br />
        </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_var</font><font color="#007700">(</font><font color="#DD0000">'persons'</font><font color="#007700">, 
        </font><font color="#0000BB">$person</font><font color="#007700">);</font> 
        </font></code></p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">ifset tag</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <p><code><font color='#000000'> <font color='#0000BB'>&lt;tpl 
        ifset=<font color='#FF0000'>"persons.email"</font>&gt;</font><font color='#007700'>&lt;a 
        href=<font color='#FF0000'>"mailto:<font color='#FF9000'>{persons.email}</font>"</font>&gt;</font><font color='#0000BB'>&lt;/tpl 
        ifset=<font color='#FF0000'>"persons.email"</font>&gt;</font><br>
        </font><font color="#FF9000">{persons.name} {persons.surname}</font><font color='#000000'><br>
        <font color='#0000BB'>&lt;tpl ifset=<font color='#FF0000'>"persons.email"</font>&gt;</font><font color='#007700'>&lt;/a&gt;</font><font color='#0000BB'>&lt;/tpl 
        ifset=<font color='#FF0000'>"persons.email"</font>&gt;</font></font></code></p>
      <p>you may use <code><font color='#000000'><font color='#0000BB'>&lt;tpl 
        ifset=<font color='#FF0000'>"var_name"</font>&gt;</font></font></code> 
        tag. If the handle is set, text in this tag will be written, else will 
        be deleted </p>
      <p>the <u>first example's</u> result:</p>
      <blockquote> 
        <p><a href="mailto:hide@address.com">Bart Simpson</a></p>
      </blockquote>
      <p><u>second example's</u> result:</p>
      <blockquote>
        <p>Bart Simpson</p>
      </blockquote></td>
  </tr>
</table>
<br>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin"> php</td>
    <td class="metod_title_main"><strong>set_loop (</strong> <font color="#004080">string</font> 
      <strong>$loop_name</strong>, <font color="#004080">array</font> <strong>$loop_value</strong> 
      <strong>)</strong></td>
  </tr>
  <tr> 
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">loop_name</font> 
        - loop's handle which should be assigned to</p>
      <p><font color="#000000">loop_value</font> - loop's values</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">simple loop</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <code><font color="#000000"> <font color="#0000BB">$loop</font> 
      = <font color="#007700">array( <br />
      &nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'name' </font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Bart'</font><font color="#007700">, </font><font color="#DD0000">'surname' 
      </font><font color="#007700">=&gt; </font><font color="#DD0000">'Simpson'</font><font color="#007700">), 
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'name'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Selma'</font><font color="#007700">, </font><font color="#DD0000">'surname'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Bouvier'</font><font color="#007700">), <br />
      &nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'name'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Waylon'</font><font color="#007700">, </font><font color="#DD0000">'surname'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Smithers'</font><font color="#007700">)); 
      <br />
      <br />
      </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_loop</font><font color="#007700">(</font><font color="#DD0000">'list'</font><font color="#007700">, 
      </font><font color="#0000BB">$loop</font><font color="#007700">);</font> 
      </font></code> </td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">simple loop</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <p><code><font color='#000000'> <font color='#007700'>&lt;table&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl loop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;tr&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font><font color='#FF9000'>{list.name}</font><font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font><font color='#FF9000'>{list.surname}</font><font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/tr&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl loop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;tr&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font>there 
        are no people in the list<font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/tr&gt;</font> <br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl noloop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        <font color='#007700'>&lt;/table&gt;</font></font></code></p>
      <p>loop should be declared between <code><font color='#000000'><font color='#0000BB'>&lt;tpl 
        loop=<font color='#FF0000'>"loop_name"</font>&gt;</font></font></code> 
        and <code><font color='#000000'><font color='#0000BB'>&lt;/tpl loop=<font color='#FF0000'>"loop_name"</font>&gt;</font></font> 
        tags. There may be <font color='#000000'><font color='#0000BB'>&lt;/tpl 
        noloop=<font color='#FF0000'>"loop_name"</font>&gt;</font></font> tag 
        also. Structure should be like this:</code></p>
      <p><code><font color='#000000'><font color='#0000BB'>&lt;tpl loop=<font color='#FF0000'>"loop_name"</font>&gt;</font></font></code><br>
        loop content<br>
        <code><font color='#000000'><font color='#0000BB'>&lt;/tpl loop=<font color='#FF0000'>"loop_name"</font>&gt;<br>
        </font></font>text which will be shown if loop array is empty<br>
        <font color='#000000'><font color='#0000BB'>&lt;/tpl noloop=<font color='#FF0000'>"loop_name"</font>&gt;</font></font> 
        </code></p>
      <p><code>variables should be declared like this: <font color='#000000'><font color='#FF9000'>{loop_name.var_name}</font></font></code></p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">loop and ifset tag</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <code><font color="#000000"> <font color="#0000BB">$loop</font> 
      = <font color="#007700">array( <br />
      &nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'name' </font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Bart'</font><font color="#007700">, </font><font color="#DD0000">'surname' 
      </font><font color="#007700">=&gt; </font><font color="#DD0000">'Simpson'</font><font color="#007700">, 
      </font><font color="#DD0000">'email' </font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'hide@address.com'</font><font color="#007700">), 
      <br />
      &nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'name'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Selma'</font><font color="#007700">, </font><font color="#DD0000">'surname'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Bouvier'</font><font color="#007700">), <br />
      &nbsp;&nbsp;&nbsp;&nbsp;array(</font><font color="#DD0000">'name'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Waylon'</font><font color="#007700">, </font><font color="#DD0000">'surname'</font><font color="#007700">=&gt; 
      </font><font color="#DD0000">'Smithers'</font><font color="#007700">, </font><font color="#DD0000">'email' 
      </font><font color="#007700">=&gt; </font><font color="#DD0000">'hide@address.com'</font><font color="#007700">)); 
      <br />
      <br />
      </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_loop</font><font color="#007700">(</font><font color="#DD0000">'list'</font><font color="#007700">, 
      </font><font color="#0000BB">$loop</font><font color="#007700">);</font> 
      </font></code> </td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">loop and ifset tag</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
	<p><code><font color='#000000'> <font color='#007700'>&lt;table&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl loop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;tr&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;a 
        href=<font color='#FF0000'>"mailto:<font color='#FF9000'>{list.email}</font>"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FF9000'>{list.name}</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/a&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FF9000'>{list.surname}</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/tr&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl loop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        <font color='#007700'>&lt;/table&gt;</font></font></code></p>
      <p>will be generated list where people (who have emails) names' will be 
        links to email them and there won't be empty links</p></td>
  </tr>
</table>
<br>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin"> php</td>
    <td class="metod_title_main"><strong>set_rotation</strong> ( <font color="#004080">string</font> 
      <strong>$loop_name</strong>, <font color="#004080">string</font> <strong>$rot_name</strong>, 
      <font color="#004080">array</font> <strong>$rot_value )</strong></td>
  </tr>
  <tr> 
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">loop_name</font> 
        - name of loop in which rotation is active</p>
      <p><font color="#000000">rot_name</font> - rotation handle in loop</p>
      <p><font color="#000000">rot_value</font> - rotation values</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">rotation in loop</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <p><code><font color="#000000"> <font color="#0000BB">$colors 
        </font><font color="#007700">= array(</font><font color="#DD0000">'#FFFFFF'</font><font color="#007700">, 
        </font><font color="#DD0000">'#F9F9F9'</font><font color="#007700">); 
        <br />
        </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_rotation</font><font color="#007700">(</font><font color="#DD0000">'list'</font><font color="#007700">, 
        </font><font color="#DD0000">'color'</font><font color="#007700">, </font><font color="#0000BB">$colors</font><font color="#007700">);</font> 
        </font></code></p>
      <p>for example if you need to make table where rows should be different 
        color.<br>
        (using example above) </p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">rotation in loop</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <p><code><font color='#000000'> <font color='#007700'>&lt;table&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl loop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;tr bgcolor=<font color="#FF0000">&quot;<font color='#FF9000'>{list.color}</font>&quot;</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;a 
        href=<font color='#FF0000'>"mailto:<font color='#FF9000'>{list.email}</font>"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FF9000'>{list.name}</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/a&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl 
        ifset=<font color='#FF0000'>"list.email"</font>&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FF9000'>{list.surname}</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/td&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#007700'>&lt;/tr&gt;</font><br>
        &nbsp;&nbsp;&nbsp;&nbsp;<font color='#0000BB'>&lt;/tpl loop=<font color='#FF0000'>"list"</font>&gt;</font><br>
        <font color='#007700'>&lt;/table&gt;</font></font></code></p>
      <p>every other row will be light grey.</p></td>
  </tr>
</table>
<br>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin"> php</td>
    <td class="metod_title_main"><strong>set_block (</strong> <font color="#004080">string</font> 
      <strong>$var_name</strong>, <font color="#004080">string</font> <strong>$block_name</strong> 
      [, <font color="#004080">string</font> <strong>$append</strong>]<strong> 
      )</strong></td>
  </tr>
  <tr> 
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">var_name</font> 
        - handle which should be assigned to</p>
      <p><font color="#000000">block_name</font> - handle of the block which content 
        should be assigned</p>
      <p><font color="#000000">append</font> ( default: false ) - if value is 
        true, then content of the block will be append to handle else content 
        will be assign. </p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">simple block</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <code><font color="#000000"> <font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_file</font><font color="#007700">(</font><font color="#DD0000">'blocks'</font><font color="#007700">, 
      </font><font color="#DD0000">'bloks.htm'</font><font color="#007700">); 
      <br />
      </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_block</font><font color="#007700">(</font><font color="#DD0000">'text_a'</font><font color="#007700">, 
      </font><font color="#DD0000">'block_a'</font><font color="#007700">); <br />
      </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">set_block</font><font color="#007700">(</font><font color="#DD0000">'text_b'</font><font color="#007700">, 
      </font><font color="#DD0000">'block_b'</font><font color="#007700">); <br />
      </font><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">parse</font><font color="#007700">(</font><font color="#DD0000">'blocks'</font><font color="#007700">);</font> 
      </font></code> </td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">html</td>
    <td class="sample_title_main">simple block<font color="#999999"> (blocks.htm)</font></td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main"> <p><code><font color='#000000'> boo<br>
        <font color='#0000BB'>&lt;tpl block=<font color='#FF0000'>"block_a"</font>&gt;</font><br>
        this is text in A<br>
        <font color='#0000BB'>&lt;/tpl block=<font color='#FF0000'>"block_a"</font>&gt;</font><br>
        <br>
        <font color='#0000BB'>&lt;tpl block=<font color='#FF0000'>"block_b"</font>&gt;</font><br>
        this is text in B<br>
        <font color='#FF9000'>{text_a}</font><br>
        this is also text in B<br>
        <font color='#0000BB'>&lt;/tpl block=<font color='#FF0000'>"block_b"</font>&gt;</font><br>
        foo<br>
        <font color='#FF9000'>{text_b}</font> </font></code></p>
      <p>result:</p>
      <p><font color="#000000">boo<br>
        <br>
        <br>
        foo<br>
        <br>
        <code><font color='#000000'>this is text in B</font></code><br>
        <br>
        <code><font color='#000000'>this is text in A</font></code><br>
        <br>
        <code><font color='#000000'>this is also text in B</font></code></font></p>
      </td>
  </tr>
</table>
<br>
<table width="350" border="0" cellspacing="0" cellpadding="0" class="metod_table">
  <tr> 
    <td width="40" class="metod_title_margin"> php</td>
    <td class="metod_title_main"><strong>parse (</strong> <font color="#004080">string</font> 
      <strong>$var_name</strong> [, <font color="#004080">string</font> <strong>$output</strong> 
      [, <font color="#004080">string</font> <strong>$file_name</strong>]] <strong>)</strong></td>
  </tr>
  <tr> 
    <td class="metod_description_margin">&nbsp;</td>
    <td class="metod_description_main"><p><font color="#000000">var_name</font> 
        - handle which should be parsed</p>
      <p><font color="#000000">output</font> ( default: 'echo' ) - output destination</p>
      <p class="metod_values">'echo' - echo text<br>
        'return' - return as the result of the function<br>
        'file' - writes into file</p>
      <p><font color="#000000">file_name</font> ( default: 'output.htm' ) - file 
        name where content should be written. It is active only if output is set 
        to 'file'</p></td>
  </tr>
</table>
<br>
<table width="200" border="0" cellpadding="0" cellspacing="0" class="sample_table">
  <tr> 
    <td width="40" class="sample_title_margin">php</td>
    <td class="sample_title_main">parsing into file</td>
  </tr>
  <tr> 
    <td class="sample_code_margin">&nbsp;</td>
    <td class="sample_code_main">
      <p>Simply prints content of the handle called 'main'</p>
      <code><font color="#0000BB">$tpleng</font><font color="#007700">-&gt;</font><font color="#0000BB">parse</font><font color="#007700">(</font><font color="#DD0000">'main'</font><font color="#007700">);</font></code><br />
    </td>
  </tr>
</table>
</body>
</html>
Return current item: Template Engine