{output 'type'} sets $padOutputType for the rest of the request and
loads that type's settings over the current ones. It decides how the whole response is
delivered once the page has finished, not what happens at the place of the tag - so it can
stand anywhere in the template. It does the same as $padOutputType set in
_config/config.php or in the page's PHP, from the template.
web - the default: the rendered page is sent to the browser.console - the rendered text written for the command line.file - the rendered page is written to a file under DATA/, named
by the $padFile* settings, and the request goes on with another page.download - the rendered page is sent as an attachment, named the same way.json and csv - what the template rendered is replaced by the
page's data: the variables its PHP names in $padExpose, as one JSON object, or the
first of them that is a list as CSV with a header row.The same JSON or CSV answer comes without the tag for ?page&padFormat=json (or
csv) and for an Accept: application/json header - and then the
template is not rendered at all. A page that exposes nothing has nothing to answer as JSON,
and CSV needs an exposed list; both are errors.
A type that is not one of the six is an error, and the mode stays as it was. Because it changes the whole response, the examples here are shown but not run.