Welcome to Ctxt

docs/docu/index
index
about/
developerlanguagemaintenance
cheat/
ajaxarray-datactxt-flagsdebugginggatesheadersindex
ctxt/
indexlanguagepatterns
engine/
indexmysql/php/
mysql/
conventionsindexpatternsschema
start/
conceptsfirst-pageindexwhat-is

ctxt

ctxt is a language for describing web pages in plain text. A page is a `.ctxt` file: a sequence of blocks, separated by blank lines. Each block is a set of `key:value` lines and configures one PHP class — an "applier" — that does one job: fetch rows from the database, place a value, build an HTML element, run an update. The order of the blocks is the order of execution. A page is data, not program code.

What building with ctxt asks

Reading and writing ctxt requires basic HTML and CSS. A block that builds an element names the element, its class and its content — the same vocabulary as the HTML it produces. Conditions are expressed as flags on a block (`require:`, `invalid:`, `validate:`), not as nested if/else structures: each block states the condition under which it runs, and blocks stay separated. This removes most of what makes conventional templating hard to follow.

What runs underneath

The appliers are a small set of reviewed PHP classes. Writing or changing these classes is programmer work at a different grade than writing pages — and for many application ideas it is not needed at all: the existing classes cover fetching, placing, rendering, updating and gating client data. Basic explanations of how an applier works internally are part of the introduction; the full class documentation is separate material.

Safety as structure

Client data (POST, cookies, URL parts) enters a page only through a gate block at the top of the file. Queries bind values with placeholders. These rules are held by the code and the file structure, not by discipline: a page that skips the gate places nothing.

The menu on this page lists the documentation sections. A basic introduction is the section `start`.