Field sigils

The character in front of a name says which value is meant and how it is written into the page. None of these opens a level - the value is spliced in where the tag stood.

Form Writes
{$name} The field, through the sanitize chain
{!name} The same field raw - the sanitize chain is skipped
{?name} The field as a query fragment: &name=url+encoded
{^name} The field as JSON, escaped for a double-quoted HTML attribute; an array is encoded whole
{#name} An option or parameter of the tag
{&name} A property of the tag
PHP
fragments/sigils_1.php
HTML
fragments/sigils_1.pad
Result
<?php

$name
= 'Tom & Jerry';
$snippet = '<b>bold</b>';
$product = [ 'name' => 'Chair', 'price' => 49.5 ];

?>
<p>Field: {$name}</p>
<p>Raw: {!snippet}</p>
<p>Query: <a href="?page{?name}">link</a></p>
<div data-props="{^product}">JSON in an attribute</div>

Field: Tom & Jerry

Raw: bold

Query: link

JSON in an attribute

The JSON form is made for mount points of client-side components: JSON.parse(elem.getAttribute('data-props')) reads it back, with no custom tag and no {ignore} pipe.

See Also