PAD - PHP Application Driver


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


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.




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

(c) 2003-2025 Herbert Groot Jebbink