PAD - PHP Application Driver


home | manual | reference | regression | sequence | develop | apps


Pages/3 ways to make a table

The @start@ / @end@ & @else@ constructs act on the number of occurences.

The {first} & {last} tags are part of the special Properties tags.

HTML RESULT
{data 'myArray'}
[1,2,3]
{/data}
{myArray}

<table border="1">
<tr> <td> Before the first occurrence </td> </tr>
@start@
<tr> <td> For every occurence </td> </tr>
@end@
<tr> <td> After the last occurrence </td> </tr>
</table>

@else@

<p> No occurences at all </p>

{/myArray}
Before the first occurrence
For every occurence
For every occurence
For every occurence
After the last occurrence
{myArray}

{first}
<table border="1">
<tr> <td> Before the first occurrence </td> </tr>
{/first}
<tr> <td> For every occurence </td> </tr>
{last}
<tr> <td> After the last occurrence </td> </tr>
</table>
{/last}

@else@

<p> No occurences at all </p>

{/myArray}
Before the first occurrence
For every occurence
For every occurence
For every occurence
After the last occurrence
{count 'myArray'}

<table border="1">
<tr> <td> Before the first occurrence </td> </tr>
{myArray}
<tr> <td> For every occurence </td> </tr>
{/myArray}
<tr> <td> After the last occurrence </td> </tr>
</table>

@else@

<p> No occurences at all </p>

{/count}
Before the first occurrence
For every occurence
For every occurence
For every occurence
After the last occurrence




Now the same code with an empty array

The {else} construct comes active when there are zero occurences for a PAD tag.

HTML RESULT
{data 'myArray'}
[]
{/data}
{myArray}

<table border="1">
<tr> <td> Before the first occurrence </td> </tr>
@start@
<tr> <td> For every occurence </td> </tr>
@end@
<tr> <td> After the last occurrence </td> </tr>
</table>

@else@

<p> No occurences at all </p>

{/myArray}

No occurences at all

{myArray}

{first}
<table border="1">
<tr> <td> Before the first occurrence </td> </tr>
{/first}
<tr> <td> For every occurence </td> </tr>
{last}
<tr> <td> After the last occurrence </td> </tr>
</table>
{/last}

@else@

<p> No occurences at all </p>

{/myArray}

No occurences at all

{count 'myArray'}

<table border="1">
<tr> <td> Before the first occurrence </td> </tr>
{myArray}
<tr> <td> For every occurence </td> </tr>
{/myArray}
<tr> <td> After the last occurrence </td> </tr>
</table>

@else@

<p> No occurences at all </p>

{/count}

No occurences at all




home | manual | reference | regression | sequence | develop | apps

(c) 2003-2025 Herbert Groot Jebbink