Core Keys (Semantic Rules)
elem
The HTML (or logical) element to create.
Examples: `div`, `span`, `h1`, `meta`, `link`, `script`, `style`, …
When `elem` is present, all subsequent non-structural keys (such as `class`, `id`, `style`, `name`, `content`, etc.) become attributes of this element.
place
Determines the target container/slot where this part’s output will be stored or printed.
Common examples:
- `print`
- `html-head`
- `html-body`
- `FTdata`
- `globals`
- `session`
- `cookie`
- `constants`
- (or any custom container you've implemented)
Rules:
- `place: print` → output is echoed immediately.
- Other values → output is stored in
`\$CP->parts[place][id]` for later assembly.
value
The inner text/HTML of the element — or payload for non-HTML targets.
Supports FT substitution:
- Square brackets `[key]`
→ lookup in FTdata, POST, SERVER (per `ValueParser` merge logic)
- Curly braces `{col}`
→ row-based replacement (e.g., when used inside `RowsLooper`)
applier
Declares the behavior class applied to this part.
Your pipeline constructs the applier and hands it the parsed part.
Examples:
`Includer` (`inc:`), `RowsLooper` (`src_array:`), `MysqlFetcher`, `DocExtractor`, …
An applier may:
- Read additional keys from the part (`src_array`, `query`, `file`, …)
- Fetch or transform data
- Generate output and place or stash it
- Override or extend the default behavior
Other Common Keys
id
Unique identifier for the part.
Also becomes the array key under `\$CP->parts[place][id]`.
Required if the output must be reused or referenced later.
elem_attr *(internal)*
A map of element attributes collected automatically after `elem:` until the part closes.
procede
Parser flow control: `continue`, `break`, etc.
Affects how subsequent parts of the file are parsed.
file_content
Loads the referenced file and assigns its contents to `value` (after FT substitution).
`FileParser` rewrites `file_content` → `value` and injects the file contents.
src_array
Triggers `RowsLooper` (or your array-applier) to iterate rows and apply `{...}` substitutions.
Interaction Rules (Practical Summary)
1. If a part contains `elem:`, all following non-structural keys become attributes for element.
2. `place:` chooses where the final output is sent (`print` or stored container).
3. `value:` becomes the element’s inner content or a payload for non-HTML containers (`session`, `constants`, etc.).
4. `applier:` may override or augment the default behavior, perform data fetches, loops, validation, or change placement.