Loops


The operator corresponding with this action looks like the following:

<TMPL_loop MODIFIERS LOOP_NAME>
    The LOOP instructions.
</TMPL_loop>


Use of MODIFIERS is not actual from the version 2, and supporting only for compability with old syntax.

Example 3.1:
Template:

<table width="100%">
    <TMPL_loop EMPLOYEE_INFO>
    <tr>
    <td>#:
<TMPL_var __COUNTER__></td>
        <td>Name: <TMPL_VAR NAME></td>
        <td>Job: <TMPL_VAR JOB></td>
        </tr></TMPL_LOOP>
</table>

Parameters:
EMPLOYEE_INFO
[
    { NAME => "John Do", JOB => "The architect" },
    { NAME => "Elizabet Tailor", JOB => "The star" }
]

Output:
<table width="100%">
    <tr>
        <td>1</td>
        <td>Name: John Do</td>
        <td>Job: The architect</td>
    </tr>
    <tr>
        <td>2</td>
        <td>Name: Elizabet Tailor</td>
        <td>Job: The star</td>
    </tr>
</table>



Copyright © 2003 - 2010 CTPP Dev. Team | http://ctpp.havoc.ru