This document provides a complete reference for all PAD tag options.
Options are specified as attributes on PAD tags:
{tagName option="value" anotherOption="value"}
Multiple options can be combined:
{data toData="myData" quote="'" glue=", " open="[" close="]"}
Options are processed at different phases during tag execution:
| Phase | When | Options |
|---|---|---|
| Start | Before content generation | track, before, dedup, page, sort, ignore, print, parent, trace, pre |
| End | After content generation | toBool, toContent, toData, tidy, dump |
| Callback | During callback execution | callback |
| Special | Handled at specific points | data, content, else, null, bool, optional, noError |
Options that specify where to get data from.
Retrieves data from a named source.
{tagName data="sourceName"}
Resolution order:
$padDataStore[$sourceName] - Data store$pqStore[$sourceName] - Sequence storepadData($sourceName) - Load from data providerExample:
{users data="cachedUsers"}
{list data="queryResults"}
Retrieves content from the content store.
{tagName content="contentName"}
Returns: Content from $padContentStore[$contentName]
Example:
{div content="savedHeader"}
Options that store results for later use.
Stores the processed data array to a named variable.
{tagName toData="variableName"}
Stores to: $padDataStore[$variableName]
Behavior:
Example:
{users where="active=1" toData="activeUsers"}
{list data="activeUsers"}...{/list}
Stores the generated content/output to a named variable.
{tagName toContent="variableName"}
Stores to: $padContentStore[$variableName]
Behavior:
$padResult[$pad] to the content storeExample:
{header toContent="pageHeader"}
{div content="pageHeader"}
Stores a boolean result based on the output state.
{tagName toBool="flagName"}
Stores to: $padBoolStore[$flagName]
Boolean logic:
TRUE if result has non-empty trimmed contentFALSE if null, else condition, or empty resultExample:
{users where="admin=1" toBool="hasAdmins"}
{if bool="hasAdmins"}...{/if}
Retrieves or creates a boolean flag value.
{if bool="flagName"}
Behavior:
$padBoolStore, returns its valuepadMakeFlag()Example:
{checkPermission toBool="canEdit"}
{if bool="canEdit"}Edit{/if}
Marks a tag as optional - suppresses “not found” errors.
{$maybeUndefined | optional}
{tagName optional}
Behavior:
padLevel('') - returns empty string on failureExample:
{$user.middleName | optional}
Marks a tag as required (callback mode).
{tagName demand}
Behavior:
Options that provide alternative content based on result state.
Provides alternative content when result is NULL.
{tagName null="alternativeContent"}
Triggers when:
NULLINFNaNBehavior:
Example:
{$user.avatar null="defaultAvatar"}
Provides alternative content when result is empty/false.
{tagName else="alternativeContent"}
Triggers when:
[]FALSE''Example:
{users where="premium=1" else="noPremiumUsers"}
Provides alternative content on error/failure state.
{tagName notOk="errorContent"}
Similar to else but for error conditions.
Alias for notOk.
{tagName error="errorContent"}
Wraps content with specified quote characters.
{tagName quote="'"}
{tagName quote='"'}
Result: 'content' or "content"
Example:
{$name quote="'"} → 'John'
Prepends content at the start of the first occurrence only.
{tagName open="prefix"}
Implementation: Wraps in {first}prefix{/first}
Example:
{list open="["} → [item1, item2, item3
Appends content at the end of the last occurrence only.
{tagName close="suffix"}
Implementation: Wraps in {last}suffix{/last}
Example:
{list close="]"} → item1, item2, item3]
Adds a separator between items (not after the last one).
{tagName glue=", "}
Implementation: Wraps in {notLast}separator{/notLast}
Example:
{list glue=", "} → item1, item2, item3
Options can be combined for complex formatting:
{list quote="'" glue=", " open="[" close="]"}
Result: ['item1', 'item2', 'item3']
Wraps content in ignore tags to skip PAD processing.
{tagName ignore}
Implementation: Wraps content as {ignore}content{/ignore}
Use case: Output literal PAD syntax without evaluation.
Cleans up whitespace and formatting in the output.
{tagName tidy}
Implementation: Calls padTidy($padContent, TRUE)
Example:
{template tidy} → Cleaned output with normalized whitespace
Suppresses error handling for the tag.
{tagName noError}
Behavior: Handled in level/var.php - prevents error reporting
Use case: When errors are expected and should be silently ignored.
Invokes an application callback for custom processing.
{tagName callback="callbackName"}
Calls: APP/_callbacks/callbackName.php
Example:
{users callback="processUsers"}
Processes callback in “before” mode - runs before content generation.
{tagName before callback="initData"}
Behavior:
padCallbackBeforeXxx('init')padCallbackBeforeRow()padCallbackBeforeXxx('exit')Options processed at the start of tag execution.
Enables tracking for the tag.
{tagName track}
Enables deduplication of data.
{tagName dedup}
Enables pagination.
{tagName page}
Enables sorting.
{tagName sort}
Handles parent relationship.
{tagName parent}
Enables tracing for debugging.
{tagName trace}
Enables preprocessing.
{tagName pre}
Outputs debug information about current state.
{tagName dump}
Calls: padDumpToDir()
Use case: Debugging template processing
Enables direct output printing with formatting options.
{tagName print}
Behavior:
{&firstFieldValue}quote, open, glue, closeExample:
{list print quote="'" glue=", "}
| Option | Direction | Description |
|——–|———–|————-|
| data | Input | Get data from source |
| content | Input | Get content from store |
| toData | Output | Store data to variable |
| toContent | Output | Store content to variable |
| toBool | Output | Store boolean flag |
| Option | Description |
|——–|————-|
| bool | Check/create boolean flag |
| optional | Suppress not-found errors |
| demand | Mark as required |
| null | Alternative for NULL |
| else | Alternative for empty/false |
| notOk | Alternative for error |
| error | Alias for notOk |
| Option | Description |
|——–|————-|
| quote | Wrap in quotes |
| open | Prefix on first item |
| close | Suffix on last item |
| glue | Separator between items |
| tidy | Clean whitespace |
| Option | Description |
|——–|————-|
| ignore | Skip PAD processing |
| noError | Suppress errors |
| callback | Run application callback |
| before | Callback before content |
| print | Direct output mode |
| dump | Debug output |
| Option | Description |
|——–|————-|
| track | Enable tracking |
| dedup | Deduplicate data |
| page | Enable pagination |
| sort | Enable sorting |
| parent | Handle parent |
| trace | Enable tracing |
| pre | Preprocessing |
Applications can define custom options by placing PHP files in:
APP/_options/optionName.php
These are processed during the app phase and have access to:
$padContent - Current content$padGetName - Option parameter valuedata, contentelsetrack, before, dedup, page, sort, ignore, print, parent, trace, prenull (if NULL result)callbacktoBool, toContent, toData, tidy, dump