PAD - PHP Application Driver


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


Reference - @xxx@ constructs - content


App: manual - Page: constructs/else_3

HTML RESULT
{data 'myArray'}
[]
{/data}
{content 'nothing'}
Nothing to see here
{/content}
{myArray else='nothing'}
Occurence {$myArray} <br>
{/myArray}
Nothing to see here
{if 1 > 2, else='nothing'}
true
{/if}
Nothing to see here



App: manual - Page: content/1

HTML RESULT
{content 'hello'}
<p> Hello World </p>
{/content}
{hello}

{hello}

{hello}

Hello World

Hello World

Hello World



App: manual - Page: content/2

HTML RESULT
{set $abc = 10}

{content 'myContent'}
{$abc} <br>
{/content}
{increment $abc} {myContent}
{increment $abc} {myContent}
{increment $abc} {myContent}
11
12
13
{set $abc = 10}

{content}
{$abc} <br>
{/content 'myContent'}
{increment $abc} {myContent}
{increment $abc} {myContent}
{increment $abc} {myContent}
10
10
10



App: manual - Page: content/3

HTML RESULT
{content 'myContent'}
Before <br>
@content@
After <br>
{/content}
{myContent}
This will be inserted <br>
{/myContent}
Before
This will be inserted
After

HTML RESULT
{content 'myContent'}
This will be inserted <br>
{/content}
{myContent}
Before <br>
@content@
After <br>
{/myContent}
Before
This will be inserted
After



App: manual - Page: content/4

HTML RESULT
{content 'myContent'}
This is my content.<br>
{/content}
{myContent}
This is my content.
{myContent}
This is the base content. <br>
{/myContent}
This is my content.
This is the base content.
{myContent merge='replace'}
This is the base content. <br>
{/myContent}
This is my content.
{myContent merge='top'}
This is the base content. <br>
{/myContent}
This is my content.
This is the base content.
{myContent merge='bottom'}
This is the base content. <br>
{/myContent}
This is the base content.
This is my content.



App: manual - Page: content/5

HTML RESULT
{content 'myContent'}
This is the true content. <br>
@else@
This is the false content. <br>
{/content}
{true content='myContent', merge='replace'}
This is the true base content <br>
@else@
This is the false base content <br>
{/true}
This is the true content.
{true content='myContent', merge='top'}
This is the true base content <br>
@else@
This is the false base content <br>
{/true}
This is the true content.
This is the true base content
{true content='myContent', merge='bottom'}
This is the true base content <br>
@else@
This is the false base content <br>
{/true}
This is the true base content
This is the true content.
{false content='myContent', merge='replace'}
This is the true base content <br>
@else@
This is the false base content <br>
{/false}
This is the false content.
{false content='myContent', merge='top'}
This is the true base content <br>
@else@
This is the false base content <br>
{/false}
This is the false content.
This is the false base content
{false content='myContent', merge='bottom'}
This is the true base content <br>
@else@
This is the false base content <br>
{/false}
This is the false base content
This is the false content.



App: manual - Page: content/6

PHP HTML RESULT
<?php

function myFunction () {

return
'This is the tag content <br>';

}

?>
{content 'myContent'}
This is content from the {content} tag <br>
{/content}
{myFunction content='myContent', merge='replace'}
This is the base content <br>
{/myFunction}
This is content from the {content} tag
{myFunction content='myContent', merge='top'}
This is the base content <br>
{/myFunction}
This is content from the {content} tag
This is the tag content
This is the base content
{myFunction content='myContent', merge='bottom'}
This is the base content <br>
{/myFunction}
This is the base content
This is the tag content
This is content from the {content} tag



App: manual - Page: content/7

HTML RESULT
{content 'myContent'}
true: This is the @content@ content. <br>
@else@
false: This is the @content@ content. <br>
{/content}
{true content='myContent'}
true
@else@
false
{/true}
true: This is the true content.
{false content='myContent'}
true
@else@
false
{/false}
false: This is the false content.

HTML RESULT
{content 'myContent'}
true
@else@
false
{/content}
{true content='myContent'}
true: This is the @content@ content. <br>
@else@
false: This is the @content@ content. <br>
{/true}
true: This is the true content.
{false content='myContent'}
true: This is the @content@ content. <br>
@else@
false: This is the @content@ content. <br>
{/false}
false: This is the false content.



App: manual - Page: miscellaneous/pad

HTML RESULT
{pad $myColor='red'}
<b> <font color="{$myColor}"> Hallo Wereld </font> </b> <br>
{/pad}
Hallo Wereld

Below example gives a sneak preview of The content tag and The data tag, 2 powerfull PAD tags.

HTML RESULT
{data 'myData'}
( "red", "green", "blue" )
{/data}
{content 'myContent'}
<b> <font color="{$myData}"> Hello World </font> </b> <br>
{/content}
{pad data='myData', content='myContent'}
Hello World
Hello World
Hello World



App: check - Page: options/sort

HTML RESULT
{content 'myContent'}
<table border=1>
<tr>
<th> volume </th>
<th> edition </th>
<th> file </th>
</tr>
@start@
<tr>
<td> {$volume} </td>
<td> {$edition} </td>
<td> {$file} </td>
</tr>
@end@
</table>
{/content}

{data 'myData'}
[ { "volume": 55, "edition": 3, "file": "file1.xml" },
{ "volume": 33, "edition": 1, "file": "file2.xml" },
{ "volume": 55, "edition": 2, "file": "file11.xml" },
{ "volume": 33, "edition": 3, "file": "file12.xml" },
{ "volume": 55, "edition": 1, "file": "file21.xml" },
{ "volume": 33, "edition": 2, "file": "file8.xml" } ]
{/data}
{myContent data='myData'}
volume edition file
55 3 file1.xml
33 1 file2.xml
55 2 file11.xml
33 3 file12.xml
55 1 file21.xml
33 2 file8.xml
{myContent data='myData', sort='volume;edition'}
volume edition file
33 1 file2.xml
33 2 file8.xml
33 3 file12.xml
55 1 file21.xml
55 2 file11.xml
55 3 file1.xml
{myContent data='myData', sort='volume DESC; edition DESC'}
volume edition file
55 3 file1.xml
55 2 file11.xml
55 1 file21.xml
33 3 file12.xml
33 2 file8.xml
33 1 file2.xml
{myContent data='myData', sort='file'}
volume edition file
55 3 file1.xml
55 2 file11.xml
33 3 file12.xml
33 1 file2.xml
55 1 file21.xml
33 2 file8.xml
{myContent data='myData', sort='file NATURAL'}
volume edition file
55 3 file1.xml
33 1 file2.xml
33 2 file8.xml
55 2 file11.xml
33 3 file12.xml
55 1 file21.xml



App: manual - Page: pages/examples_used_in_this_manual
PHP
HTML
pages/examples_used_in_this_manual.pad
Result
{block}
<p>This manual will use the {tag 'pad'} tag for general PAD features.
<p>Below the internal PHP code for the {tag 'pad'} tag. That is not so much ))</p>
<p>{example 'miscellaneous/true', skipHeader, skipPad, skipResult}</p>
<p>As the {tag 'pad'} tag does not do anything itself, it must be given content & data.
<br>(if there is no data assigned to it then it will have default 1 data occurence)
{/block}

{page 'miscellaneous/pad'}

{page 'staff/index'}

This manual will use the {pad} tag for general PAD features.

Below the internal PHP code for the {pad} tag. That is not so much ))

<?php

return TRUE;

?>

As the {pad} tag does not do anything itself, it must be given content & data.
(if there is no data assigned to it then it will have default 1 data occurence)

HTML RESULT
{pad $myColor='red'}
<b> <font color="{$myColor}"> Hallo Wereld </font> </b> <br>
{/pad}
Hallo Wereld

Below example gives a sneak preview of The content tag and The data tag, 2 powerfull PAD tags.

HTML RESULT
{data 'myData'}
( "red", "green", "blue" )
{/data}
{content 'myContent'}
<b> <font color="{$myData}"> Hello World </font> </b> <br>
{/content}
{pad data='myData', content='myContent'}
Hello World
Hello World
Hello World

In the _data directory there is the file staff.xml, it is often used in this manual.

<xml>
<row name="joe" salary="1000" bonus="500" phone="555-1111" />
<row name="jim" salary="2000" bonus="400" phone="555-2222" />
<row name="john" salary="3000" bonus="300" phone="555-3333" />
<row name="jack" salary="4000" bonus="200" phone="555-4444" />
<row name="jerry" salary="5000" bonus="100" phone="555-5555" />
</xml>

Files placed in the _data directory can be used as a PAD tag.

<table border=1>
{staff}
<tr>
<td> {$name} </td>
<td> {$phone} </td>
</tr>
{/staff}
</table>
joe 555-1111
jim 555-2222
john 555-3333
jack 555-4444
jerry 555-5555



App: manual - Page: pages/start_end

The @start@ & @end@ constructs limits the occurce content of a tag to the content between those 2 constructs

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>

{/myArray}
Before the first occurrence
For every occurence
For every occurence
For every occurence
After the last occurrence
{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



App: manual - Page: pages/the_content_tag
PHP
HTML
pages/the_content_tag.pad
Result
{block}
With the <b>{content}</b> tag it is possible to define content for later use.
{/block}

{page 'content/1'}

<hr><h4>Open or close tag</h4>

{block}
<p>If <b>{content 'xxx'}</b> is used, then the content will not be processed before it is stored in the content store</p>
<p>If <b>{/content 'xxx'}</b> is used, then the content will be processed before it is stored in the content store</p>
{/block}

{page 'content/2'}

<hr><h4>Merge content with content - part 1</h4>

{page 'content/4'}

<hr><h4>Merge content with content - part 2</h4>

{page 'content/3'}

<hr><h4>Merge content with content - part 3</h4>

{page 'content/5'}

<hr><h4>Merge content with content - part 4</h4>

{page 'content/6'}

<hr><h4>Merge content with content - part 5</h4>

{page 'content/7'}
With the {content} tag it is possible to define content for later use.

HTML RESULT
{content 'hello'}
<p> Hello World </p>
{/content}
{hello}

{hello}

{hello}

Hello World

Hello World

Hello World


Open or close tag

If {content 'xxx'} is used, then the content will not be processed before it is stored in the content store

If {/content 'xxx'} is used, then the content will be processed before it is stored in the content store

HTML RESULT
{set $abc = 10}

{content 'myContent'}
{$abc} <br>
{/content}
{increment $abc} {myContent}
{increment $abc} {myContent}
{increment $abc} {myContent}
11
12
13
{set $abc = 10}

{content}
{$abc} <br>
{/content 'myContent'}
{increment $abc} {myContent}
{increment $abc} {myContent}
{increment $abc} {myContent}
10
10
10


Merge content with content - part 1

HTML RESULT
{content 'myContent'}
This is my content.<br>
{/content}
{myContent}
This is my content.
{myContent}
This is the base content. <br>
{/myContent}
This is my content.
This is the base content.
{myContent merge='replace'}
This is the base content. <br>
{/myContent}
This is my content.
{myContent merge='top'}
This is the base content. <br>
{/myContent}
This is my content.
This is the base content.
{myContent merge='bottom'}
This is the base content. <br>
{/myContent}
This is the base content.
This is my content.


Merge content with content - part 2

HTML RESULT
{content 'myContent'}
Before <br>
@content@
After <br>
{/content}
{myContent}
This will be inserted <br>
{/myContent}
Before
This will be inserted
After

HTML RESULT
{content 'myContent'}
This will be inserted <br>
{/content}
{myContent}
Before <br>
@content@
After <br>
{/myContent}
Before
This will be inserted
After


Merge content with content - part 3

HTML RESULT
{content 'myContent'}
This is the true content. <br>
@else@
This is the false content. <br>
{/content}
{true content='myContent', merge='replace'}
This is the true base content <br>
@else@
This is the false base content <br>
{/true}
This is the true content.
{true content='myContent', merge='top'}
This is the true base content <br>
@else@
This is the false base content <br>
{/true}
This is the true content.
This is the true base content
{true content='myContent', merge='bottom'}
This is the true base content <br>
@else@
This is the false base content <br>
{/true}
This is the true base content
This is the true content.
{false content='myContent', merge='replace'}
This is the true base content <br>
@else@
This is the false base content <br>
{/false}
This is the false content.
{false content='myContent', merge='top'}
This is the true base content <br>
@else@
This is the false base content <br>
{/false}
This is the false content.
This is the false base content
{false content='myContent', merge='bottom'}
This is the true base content <br>
@else@
This is the false base content <br>
{/false}
This is the false base content
This is the false content.


Merge content with content - part 4

PHP HTML RESULT
<?php

function myFunction () {

return
'This is the tag content <br>';

}

?>
{content 'myContent'}
This is content from the {content} tag <br>
{/content}
{myFunction content='myContent', merge='replace'}
This is the base content <br>
{/myFunction}
This is content from the {content} tag
{myFunction content='myContent', merge='top'}
This is the base content <br>
{/myFunction}
This is content from the {content} tag
This is the tag content
This is the base content
{myFunction content='myContent', merge='bottom'}
This is the base content <br>
{/myFunction}
This is the base content
This is the tag content
This is content from the {content} tag


Merge content with content - part 5

HTML RESULT
{content 'myContent'}
true: This is the @content@ content. <br>
@else@
false: This is the @content@ content. <br>
{/content}
{true content='myContent'}
true
@else@
false
{/true}
true: This is the true content.
{false content='myContent'}
true
@else@
false
{/false}
false: This is the false content.

HTML RESULT
{content 'myContent'}
true
@else@
false
{/content}
{true content='myContent'}
true: This is the @content@ content. <br>
@else@
false: This is the @content@ content. <br>
{/true}
true: This is the true content.
{false content='myContent'}
true: This is the @content@ content. <br>
@else@
false: This is the @content@ content. <br>
{/false}
false: This is the false content.



App: manual - Page: prefix/prefix

HTML RESULT
<h3>From an pad tag</h3>

{pad:foo}

From an pad tag

Foo tag from pad
<h3>From an application tag </h3>

{app:foo}

From an application tag

Foo tag from app
<h3>From the {content} tag </h3>

{content:foo}

From the {content} tag

This is from content
<h3>From a PHP function !</h3>

{php:foo}

From a PHP function !

This is a function
<h3>From an own PAD function </h3>

{function:foo}

From an own PAD function

From an own function
<h3>From an defined bool</h3>

{bool:foo}
Bool 'foo' is true
@else@
Bool 'foo' is false
{/bool:foo}

From an defined bool

Bool 'foo' is true
<h3>From a PHP array</h3>

{array:foo}
{$foo} <br>
{/array:foo}

From a PHP array

This is a PHP array - 1
This is a PHP array - 2
This is a PHP array - 3
<h3>A defined constant</h3>

{constant:foo}
{$foo} <br>
{/constant:foo}

A defined constant

This is a constant - 1
This is a constant - 2
This is a constant - 3
<h3>From the {data} tag</h3>

{data:foo}
{$foo} <br>
{/data:foo}

From the {data} tag

This is a json array - 1
This is a json array - 2
This is a json array - 3
<h3>From the local _data directory</h3>

{local:foo}
{$foo} <br>
{/local:foo}

From the local _data directory

From the _data directory - 1
From the _data directory - 2
From the _data directory - 3
<h3>From the local _scripts directory</h3>

{script:foo}

From the local _scripts directory

Hello from foo.py



App: check - Page: select/support/topic
PHP
HTML
select/support/topic.pad
Result
{content 'who'}
{users}
<p>@content@ by {$username}
{/users}
on {$created_at | substr (0, 16)}</p>
{/content}

{forum_topics $id=1}

{forum_boards}
<h1>Board: {$name}</h1>
{/forum_boards}

<h2>Topic: {$title}</h2>

{who}Started{/who}

{forum_posts}

<hr>

{who}Posted{/who}

<p>{$content}</p>

@else@

<p>No posts yet</p>

{/forum_posts}

{/forum_topics}

Board: PAD Tags & Templates

Topic: Topic Title

Started by admin on 2025-12-19 16:40


Posted by herbert on 2025-12-19 16:41

My first posting


Posted by herbert on 2025-12-19 18:35

My second posting





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

(c) 2003-2025 Herbert Groot Jebbink