This document provides a complete reference for all PAD tag types.
Every PAD tag has a type that determines how it’s processed. Types are automatically detected based on the tag name, or can be explicitly specified using the type:name syntax.
{tagName}
PAD automatically detects the type based on what tagName matches.
{type:name}
Explicitly specify the type for disambiguation.
Examples:
{users} ← Auto-detected as 'table' type
{table:users} ← Explicitly specified as table type
{field:username} ← Explicitly field type
{php:strtoupper} ← Explicitly PHP function type
When no explicit type is given, PAD checks in this order:
APP2/PAD/tags/Loads application-specific tags from the APP2/ directory.
{myCustomTag}
{app:myCustomTag}
Resolution: Checks padAppTagCheck() for tag in application directory.
Files loaded:
APP2/myCustomTag.php - PHP logicAPP2/myCustomTag.pad - PAD templateUse case: Application-specific custom tags.
Loads built-in PAD tags from the PAD/tags/ directory.
{if}
{pad:if}
Resolution: PAD/tags/{tagName}.php or .pad
Files loaded:
PAD/tags/{name}.php - PHP logicPAD/tags/{name}.pad - PAD templateUse case: Core PAD framework tags.
Retrieves data from the data store ($padDataStore).
{data:myData}
{myData} ← If myData exists in data store
Resolution: $padDataStore[$tagName]
Options:
print - Output with formattingExample:
{users toData="activeUsers"}
{data:activeUsers}
Retrieves content from the content store ($padContentStore).
{content:header}
Resolution: $padContentStore[$tagName]
Example:
{header toContent="savedHeader"}
{content:savedHeader}
Retrieves boolean values from the boolean store ($padBoolStore).
{bool:isAdmin}
Resolution: $padBoolStore[$tagName]
Returns: The stored boolean value.
Example:
{checkAdmin toBool="isAdmin"}
{if bool:isAdmin}...{/if}
Retrieves field values from the current data context.
{field:username}
{$username} ← Shorthand for field
Resolution: padFieldValue($tagName)
Returns: Field value, or NULL if field is null.
Example:
{users}{field:email}{/users}
{users}{$email}{/users} ← Equivalent
Retrieves tag properties from parent tags.
{property:id}
{@id} ← Shorthand for property
Resolution: padTagValue($tagName)
Supports: Parameter prefixing with $padParm.
Example:
{list}{@index}{/list}
Retrieves array values by name.
{array:myArray}
Resolution: padArrayValue($tagName)
Use case: Access named arrays in the current context.
Retrieves level variables from the processing stack.
{level:varName}
Resolution: padGetLevelArray($tagName)
Use case: Access variables from parent processing levels.
Retrieves PHP constants by name.
{constant:PHP_VERSION}
{constant:APP}
Resolution: constant($tagName)
Returns: The value of the PHP constant.
Example:
{constant:PHP_EOL}
{constant:TRUE}
Loads local data files with automatic type detection.
{local:data/users.json}
{myfile.csv}
Resolution: padDataFileName($tagName)
Supported formats:
.php - Executes PHP and returns result.json - Parsed as JSON.csv - Parsed as CSV.xml - Parsed as XMLOptions:
name - Override data nametype - Override file typesandbox - Enable sandboxed processingExample:
{local:config/settings.json}
{data.csv name="myData" type="csv"}
Includes content from application include files.
{include:header}
Resolution: padAppIncludeCheck($tagName)
Returns: Included file content.
Queries database tables.
{table:users}
{users} ← If 'users' is a known table
Resolution: padTable($tagName)
Returns: Query results as array.
Example:
{table:users where="active=1"}
{$name}
{/table:users}
Executes PAD functions as tags.
{function:trim}content{/function:trim}
{trim}content{/trim}
Resolution: padFunctionAsTag($tagName)
Behavior:
Example:
{upper}hello{/upper} → HELLO
{replace 'a' 'b'}aaa{/replace} → bbb
Calls PHP built-in functions directly.
{php:strtoupper 'hello'}
{php:date 'Y-m-d'}
Resolution: function_exists($tagName)
Implementation: call_user_func_array($tagName, $parameters)
Example:
{php:strlen 'hello'} → 5
{php:array_sum (1,2,3)} → 6
Executes external shell scripts.
{script:myscript}
{script:processor.sh arg1 arg2}
Resolution: padScriptCheck($tagName)
Features:
escapeshellarg()Returns: Script output (stdout).
Example:
{script:generate.sh template="main"}
Loads application pages.
{page:home}
{xyz:dashboard}
Resolution: padAppPageCheck($tagName)
Returns: Page content via PAD/get/page.php.
Alias for page type.
{xyz:pageName}
Implementation: Includes PAD/get/page.php.
These types integrate with the PAD sequence subsystem.
Accesses sequence type definitions.
{sequence:fibonacci}
Resolution: file_exists(PT . $tagName)
Implementation: Delegates to PQ/start/types/sequence.php.
Executes sequence actions.
{action:sum}
{mySequence:sum}
Resolution: file_exists(PQ/actions/types/$tagName.php)
Implementation: Delegates to PQ/start/types/action.php.
Retrieves values from the sequence store.
{pull:mySequence}
{mySequence} ← If exists in pqStore
Resolution: isset($pqStore[$tagName])
Implementation: Delegates to PQ/start/types/pull.php.
Handles sequence flags.
{flag:myFlag}
Resolution: isset($padBoolStore[$tagName])
Implementation: Delegates to PQ/start/types/flag.php.
Creates new sequence values.
{make:fibonacci}
{fibonacci:make}
Resolution: Sequence exists + make type available.
Implementation: Delegates to PQ/start/types/make.php.
Keeps/stores sequence values.
{keep:mySequence}
Implementation: Delegates to PQ/start/types/keep.php.
Removes sequence values.
{remove:mySequence}
Implementation: Delegates to PQ/start/types/remove.php.
| Type | Source | Description |
|---|---|---|
app |
APP2/ | Application-specific tags |
pad |
PAD/tags/ | Built-in PAD tags |
data |
$padDataStore | Stored data arrays |
content |
$padContentStore | Stored content strings |
bool |
$padBoolStore | Boolean flags |
field |
Current data | Field values |
property |
Parent tag | Tag properties |
array |
Arrays | Named arrays |
level |
Stack | Level variables |
constant |
PHP | PHP constants |
local |
Files | Local data files |
include |
APP | Include files |
table |
Database | Table queries |
function |
PAD/functions/ | PAD functions |
php |
PHP | PHP functions |
script |
Scripts | Shell scripts |
page |
APP | Application pages |
xyz |
APP | Page alias |
sequence |
PQ | Sequence types |
action |
PQ | Sequence actions |
pull |
pqStore | Sequence values |
flag |
pqStore | Sequence flags |
make |
PQ | Sequence creation |
keep |
PQ | Sequence storage |
remove |
PQ | Sequence removal |
Each type has a corresponding handler in PAD/types/:
types/
├── action.php → Sequence action
├── app.php → Application tag
├── array.php → Array value
├── bool.php → Boolean store
├── constant.php → PHP constant
├── content.php → Content store
├── data.php → Data store
├── field.php → Field value
├── flag.php → Sequence flag
├── function.php → PAD function
├── include.php → Include file
├── keep.php → Sequence keep
├── level.php → Level variable
├── local.php → Local file
├── make.php → Sequence make
├── pad.php → PAD tag
├── php.php → PHP function
├── property.php → Tag property
├── pull.php → Sequence pull
├── remove.php → Sequence remove
├── script.php → Shell script
├── sequence.php → Sequence type
├── table.php → Database table
├── xyz.php → Page type
└── go/
├── local.php → Local file processing
├── table.php → Table processing
└── tag.php → Tag file loading
{users where="active=1" toData="activeUsers"}
{if data:activeUsers}
<h2>Active Users ({php:count data:activeUsers})</h2>
{data:activeUsers}
<div>{field:name} - {field:email}</div>
{/data:activeUsers}
{else}
<p>No active users</p>
{/if}
<footer>{constant:APP_VERSION}</footer>
{-- 'date' could be a field, function, or PHP function --}
{field:date} ← Get date field value
{function:date} ← Use PAD date function
{php:date 'Y-m-d'} ← Use PHP date function
{fibonacci:make 1 10}
{fibonacci:sum}
{fibonacci:pull}
{fibonacci:remove}