{code}...{/code} takes its content as PAD source and renders it in a
separate engine pass - a fresh build, as if the content were a little page of its own - and
outputs what that pass produced. Inside, everything a page can do works: tags, fields,
expressions, {set}.
Its main use is as a pipe. A value is text in PAD: a field holding
{echo 1 + 1} prints those characters, it does not run them. Piping the value into
code - {echo $snippet | code} - is the explicit way to say that it
is a template, for a snippet kept in a database or a file.
By default the pass shares the page's state: it sees the variables and the stores, and what it sets stays behind. Four options change how isolated it is:
sandbox - nothing in, nothing out; the same as the
{sandbox} tag and the sandbox pipe;reset - the levels and the stores start empty and are put back afterwards,
while variables are shared as in a plain pass;clean - the pass sees everything, and what it created or changed is
undone when it ends;function='name' - the pass runs inside a PHP function, so variables
get a scope of their own; what it creates is copied out unless sandbox is
given too.The same four options are read by {page}, which runs a whole page in such a pass. To show braces without running them, the opposite tool is {ignore}.