Tags by form

A tag is written alone, {name ...}, around content, {name ...} ... {/name}, or either way.

Single tags

Written alone - {name ...} - and replaced by what they answer - 68 tags
  • {ajax} Writes an empty div and a script that has the browser fetch another page into it after the page has loaded. Pages and execution
  • {assert} A condition a test run holds the page to; silent everywhere else. Debugging and errors
  • {asset} The address of a file of www/<app>/ with a version of its contents, safe behind a far-future cache header. Output control
  • {at} Looks a value up in a data set by a path of names and conditions - the @ notation as a tag. Variables and stores
  • {attrs} Writes HTML attributes from values - quoted and escaped, a true boolean attribute bare, a false one left out. Text and formatting
  • {avatar} Draws an initials avatar as inline SVG - the letters of a name in a circle coloured by a hash of it, no image needed. Pictures and media
  • {barcode} Draws a barcode as inline SVG - EAN-13, EAN-8, UPC-A or Code 128, encoded on the server. Charts and codes
  • {break} Leaves a loop at once: the rest of the current pass is dropped and no further row follows. Loops and trees
  • {cease} Ends a loop gracefully: the current pass finishes, and no further row follows. Loops and trees
  • {chess} A chess position from FEN as an SVG board, with marked squares and arrows. Games
  • {classes} Builds a class list from fixed names and names that are in only while their condition holds. Text and formatting
  • {close} Writes a literal closing brace that the template engine does not read as the end of a tag. Output control
  • {continue} Skips the rest of the current pass of a loop and goes on with its next row. Loops and trees
  • {countdown} The time left until a moment, in words inside a time element - ticking every second in the browser when asked. Text and formatting
  • {country} Writes a country's flag from its ISO 3166 code or English name, optionally with the name beside it. Pictures and media
  • {csrf} The hidden form field holding the CSRF token of the visitor's session, or the bare token. Forms and security
  • {curl} Fetches a URL and answers the body of the response, optionally kept in a cache for a number of seconds. Network and mail
  • {debug} Shows values as a collapsible tree in the page, for a local request only, while rendering goes on. Debugging and errors
  • {decrement} Takes one off a variable, starting it at -1 when it does not exist yet. Variables and stores
  • {diff} Shows what changed between two texts - word by word in the flow of the text, or line by line in one column or side by side. Text and formatting
  • {dump} Stops the request and shows the debug dump of the engine's state at that point. Debugging and errors
  • {echo} Evaluates an expression and prints the result - the general output tag, and the one to put in front of a pipe. Output control
  • {emoji} An emoji by its GitHub or Slack shortcode, as a labelled image a screen reader names. Text and formatting
  • {error} Raises a PAD error from the template, handled as the configured error action says. Debugging and errors
  • {exception} Throws a real PHP exception from the template, to exercise the error handling. Debugging and errors
  • {excerpt} Cuts a long text to whole words with an ellipsis, centred on the first match of search words, every match marked. Text and formatting
  • {exit} Ends the request at once, with an empty body - the PAD way to stop instead of PHP's exit. Debugging and errors
  • {extends} Frames the page with a layout instead of its directories' wrappers. Layouts and components
  • {field} Runs a SQL query on the application database and prints the single value it answers. Database
  • {flush} Sends the page rendered so far to the browser at once, so it can load the stylesheets while a slow part below renders. Output control
  • {foo} A built-in demo tag that answers a fixed line, there to show how the type prefixes resolve a name. Output control
  • {get} Fetches another page of the application over HTTP, as a second request, and inserts its output. Pages and execution
  • {gravatar} Writes the Gravatar picture of an e-mail address as an img - only a hash of the address leaves the page - or a local avatar instead. Pictures and media
  • {icon} Writes an interface icon from PAD's own set of 79 as inline SVG, drawn in the colour of the text around it. Pictures and media
  • {identicon} Draws a GitHub-style identicon as inline SVG - a symmetric 5 by 5 pattern and a colour from a hash of the value. Pictures and media
  • {img} Writes a picture of the application's www directory as a thumbnail of the size the page shows it at, resized once with GD. Pictures and media
  • {increment} Adds one to a variable, starting it at 1 when it does not exist yet. Variables and stores
  • {input} A form field with its label that refills from what its form sent and shows the error validation found for it. Forms and security
  • {lorem} Placeholder text - Lorem ipsum and Latin words - in words, sentences or paragraphs, the same text for the same seed. Text and formatting
  • {meta} The page's metadata - a title, a layout, a cache time or any value - read while the page is assembled. Layouts and components
  • {nonce} This request's Content-Security-Policy nonce, for a script or style the policy lets run. Forms and security
  • {open} Writes a literal opening brace that the template engine does not read as the start of a tag. Output control
  • {output} Switches how the running request answers - a web page, the console, a file, a download, JSON or CSV. Output control
  • {page} Renders another page of the application - its PHP and its template - in place of the tag. Pages and execution
  • {parent} Inside an overriding block: the content of the block it overrides. Layouts and components
  • {parms} Declares the parameters of a custom tag, with defaults, at the top of its template. Layouts and components
  • {placeholder} Draws a grey image placeholder as inline SVG - crossing lines and the size or a text in the middle. Pictures and media
  • {poll} A vote among a few answers, once per visitor, then the results as bars with percentages. Widgets
  • {progress} Writes an accessible progress bar - the native progress element, styled, with its label and percentage - or a row of step dots. Pictures and media
  • {qr} Draws a QR code as inline SVG, encoded on the server - no image library, no remote service. Charts and codes
  • {rating} Draws a score as stars or hearts in inline SVG - whole ones filled, a part of one clipped - and says it in words. Pictures and media
  • {reactData} Writes the mount point of a React component, its data from a provider in _providers/ as JSON in an attribute. Output control
  • {recurse} Inside a {tree}: renders the tree's body once more for the children of the current row. Loops and trees
  • {redirect} Sends the browser to another page or address with a 302 and ends the request. Navigation
  • {restart} Abandons the page being built and renders another page in its place, in the same request. Pages and execution
  • {resume} Transforms the sequence pushed last, in place, through an action or a play. Sequences
  • {set} Assigns one or more variables, as globals that outlive the level the tag stands in. Variables and stores
  • {source} Shows the files behind a page as tabs, each coloured as highlight colours it - the code shown is the code that runs. Text and formatting
  • {stack} Prints everything pushed to a named stack, from above or below it in the page. Layouts and components
  • {sudoku} A sudoku as a table, the givens bold - and with solve, solved on the server. Games
  • {switch} Answers the next value of a rotating list on every call - striped rows without a counter. Conditions
  • {textarea} A text area with its label that refills from what its form sent and shows the error validation found for it. Forms and security
  • {timeago} How long ago a moment was, in words, inside a time element that keeps the exact moment as its datetime and title. Text and formatting
  • {toc} A table of contents of the page from its own rendered headings, nested and linked - filled in once the page has rendered. Text and formatting
  • {trans} Writes the text a key has in the _lang/ catalog of the request's locale, with plural forms and substitutions. Output control
  • {validator} The browser's checker of the validation rules as one inline script, for a form a component draws. Forms and security
  • {video} Shows a YouTube or Vimeo video as its poster with a play button, loading the player only when pressed - or a video file as a video element. Pictures and media
  • {vite} Links the scripts and stylesheets of a Vite build by the name of their source - or the dev server while it runs. Output control

Tag pairs

Written around content - {name ...} ... {/name} - 53 tags
  • {accordion} Items that open and close on a click, each a details element - no JavaScript. Widgets
  • {action} Runs one sequence action - reverse, sum, first and the rest - over a store, a range or a type, and iterates the result. Sequences
  • {array} Runs a SQL query on the application database and repeats its content once per row. Database
  • {auth} Renders its content when a user is logged in, with the user's row as its data, and its else half for a guest. Users and access
  • {block} A named region of a layout or wrapper - and a page's override of it. Layouts and components
  • {branch} Inside a {tree}: renders its content only when the current row has children, its @else@ part for a leaf. Loops and trees
  • {cache} Keeps a named section of the page rendered for a number of seconds - the fragment cache. Output control
  • {can} Renders its content when the user may do something a gate decides, and its else half when not. Users and access
  • {cannot} Renders its content when the user may not do something a gate decides - can turned round. Users and access
  • {carousel} Slides in a row that scrolls and snaps sideways, with arrow links and dots - no JavaScript needed. Widgets
  • {case} Renders the one branch whose {when} matches a value, with an {else} for none. Conditions
  • {check} Asks the application database whether a row exists, and renders its content only when one does. Database
  • {code} Runs its content as PAD source in a separate engine pass and outputs what that pass produced. Pages and execution
  • {collection} Reads a folder of Markdown files from _content/ and repeats its content once per file, the front matter as fields. Database
  • {count} Renders its content only when a named data set or page array holds at least one element. Variables and stores
  • {crossword} A crossword made from a list of words: a numbered SVG grid with the Across and Down clues. Games
  • {define} Writes a custom tag in the template itself - what a _tags/name.pad file is, without the file. Layouts and components
  • {diagram} Draws a flowchart or a sequence diagram from Mermaid-style lines of text, laid out on the server as inline SVG. Charts and codes
  • {dir} Lists the names in a directory, one occurrence each - the plain version of files. Files
  • {exists} Renders its content when a file or directory is there, its else half when not. Files
  • {feature} Renders its content while a feature flag is on for this visitor, and its else half while it is off. Users and access
  • {file} Writes its rendered content to a file under DATA/ instead of to the page. Files
  • {files} Scans a directory and iterates its entries, with path, file, ext, item and dir for each. Files
  • {flag} Replaces every value of a sequence with 1 or 0: whether it belongs to a sequence type. Sequences
  • {flash} The flash messages of this request - set with padFlash on the page before - one occurrence each. Forms and security
  • {form} A form that posts back to the page, carrying the session's CSRF token and its own name, its fields refilling when it came back. Forms and security
  • {fragment} A named part of the page that a request can ask for alone - for htmx and ajax swaps. Layouts and components
  • {guest} Renders its content when nobody is logged in, and its else half for a user. Users and access
  • {if} Renders its content only when a condition holds, with elseif and else branches. Conditions
  • {ifchanged} Renders its content when a value differs from the previous row of the loop around it - a heading per group. Conditions
  • {ignore} Keeps PAD from reading the braces in its content as tags - for inline JavaScript, CSS, JSON and code samples. Output control
  • {keep} Keeps only the values of a sequence that belong to a sequence type. Sequences
  • {live} A region of the page that re-renders on the server when something in it is clicked, submitted or changed, and swaps itself in. Pages and execution
  • {macro} A template function: declared parameters, given in order or by name, read as fields inside its body. Layouts and components
  • {make} Replaces every value of a sequence with what a sequence type makes of it. Sequences
  • {modal} A dialog over the page with the button that opens it - works with and without JavaScript. Widgets
  • {nocache} Marks a part of a cached page or {cache} section that renders again on every request, the hit included. Output control
  • {pad} A tag with no behaviour of its own: its content renders once, or per row with data=, carrying the generic options. Pages and execution
  • {pull} Iterates a stored sequence, optionally through plays and actions. Sequences
  • {push} Renders its content and adds it to a named stack, for a stack tag elsewhere in the page to print. Layouts and components
  • {record} Runs a SQL query on the application database and renders its content with the first row's columns as fields. Database
  • {remove} Removes the values of a sequence that belong to a sequence type - the inverse of keep. Sequences
  • {sandbox} Runs its content as PAD source in an isolated pass that cannot see or leave behind anything of the page. Pages and execution
  • {shadow} The shadow root of a custom element, rendered on the server as declarative shadow DOM. Layouts and components
  • {sitemap} Lists the pages of the application, read from the file tree, as rows with page, url and lastmod. Navigation
  • {spaceless} Takes out the whitespace between HTML tags, and at both ends of the content. Output control
  • {tab} One item of a tabs, accordion or carousel: its label and its content, handed to that owner. Widgets
  • {tabs} Panels behind a row of tabs, switched by radio buttons and CSS - no JavaScript. Widgets
  • {tidy} Rewrites the HTML it wraps as tidied, indented markup through PHP's tidy extension. Output control
  • {trace} Switches the execution trace on for just the part of the page it wraps. Debugging and errors
  • {tree} Renders a tree of rows: its body for every row, and {recurse} renders it again for the row's children. Loops and trees
  • {until} Renders its content again and again until a condition becomes true. Loops and trees
  • {while} Renders its content again and again for as long as a condition holds. Loops and trees

Either form

Alone or as a pair - the pair form gives them content to use - 21 tags
  • {bool} Reduces its content or a value to TRUE or FALSE and keeps it under a name, for a later {name} to test. Variables and stores
  • {calendar} Writes a month as a calendar table with its events, or hands over its weeks and days as rows for markup of your own. Charts and codes
  • {chart} Draws a chart as inline SVG on the server - 46 kinds, from bars and lines to sankeys, maps of a hierarchy and org charts. Charts and codes
  • {content} Keeps a piece of template under a name instead of printing it, for a later {name} to render. Variables and stores
  • {copy} A text in a code block with a button that copies it to the clipboard. Widgets
  • {data} Turns its content - JSON, XML, YAML, CSV, a list or a range - into a named data set for a later tag to iterate. Variables and stores
  • {datatable} Rows as a complete HTML table - formatted numbers, a totals row, sorting and paging on the server. Widgets
  • {false} The constant FALSE: its content is skipped and its @else@ part renders instead. Conditions
  • {highlight} Colours source code on the server - PAD, PHP, HTML, CSS, JavaScript, JSON, YAML, SQL or shell - with optional line numbers and marked lines. Text and formatting
  • {jsonview} A JSON value or a PHP array as a tree that folds open and shut, coloured by type. Widgets
  • {mail} Renders a template, or its own content, to an e-mail with an HTML and a text part, and sends it. Network and mail
  • {map} Draws a choropleth map as inline SVG - every country coloured by a value of its row - of the world or one of its regions. Charts and codes
  • {markdown} Renders its content, or the value of its parameter, as Markdown and writes the HTML. Text and formatting
  • {null} The constant NULL: its content is dropped, the @else@ part too, and a null= option fires. Conditions
  • {pager} Page links for a tag written with the page option: first and last, a window round the current page, previous and next. Navigation
  • {pdf} Sends what its content renders as a PDF instead of the page - a writer in plain PHP, the standard fonts, no library. Pictures and media
  • {sequence} Generates a range, a list or one of 80 mathematical sequences, and iterates its values. Sequences
  • {slot} A named place in a custom tag's template - and the fill a caller gives it. Layouts and components
  • {sparkline} Draws a word-sized line chart as inline SVG - no axes, the last point marked - to stand in a sentence or a table cell. Charts and codes
  • {timeline} Draws events on a time axis as inline SVG - cards above and below the axis, spans as bars, or one under the other. Charts and codes
  • {true} The constant TRUE: its content renders once, as a level of its own. Conditions