TextDocument
MMO\core\documents · 1 symbol · generated 5 Oct 2026
TextDocument
TextDocument.php:13A plain-text Document (rendered via TextPrinter by default) that appends any recorded
- Namespace
MMO\core\documents- Extends
- Document
- See
Logentries after the body, one per line, instead of just exposing them viagetLogs.
Methods1
render($opts)
TextDocument.php:18Inherited members (51)
| Properties | Declared by | Description | |
|---|---|---|---|
body | Document | ||
importPaths | Document | ||
links | Document | ||
logs | Document | ||
meta | Document | Free-form metadata about this document (e.g. | |
opts | Document | ||
readOnly | Document | If true, the document's body/links/meta can no longer be modified (setters throw eRuntime). |
| Methods | Declared by | Description | |
|---|---|---|---|
addContent($data) | Document | Recursively merge $data into the current body (see merge). | |
addImportPath($path, $first) | Document | Add one base directory to the import search paths. | |
addLink($link) | Document | Append a link to this document. | |
addMeta($data) | Document | Recursively merge $data into $meta (existing keys are overwritten, not combined -- see merge's $combine argument). | |
addOptions($opts, $appendList) | Document | Merge $opts into the existing options (through merge), rather than replacing them wholesale like setOptions. | |
addVars($vars) | Document | Merge extra variables into the set made available to import()-ed files. | |
clearLogs() | Document | Discard all recorded logs. | |
clearOptions() | Document | Empty the options bag. | |
createStream() | Document | ||
findImportPath($filename) | Document | Resolve a relative filename against getImportPaths (first match wins). | |
getBody() | Document | ||
getImportPaths() | Document | ||
getLinkByRel($rel) | Document | ||
getLinks() | Document | Returns an iterable of LinkInterface objects. | |
getLinksByRel($rel) | Document | Returns an iterable of LinkInterface objects that have a specific relationship. | |
getLogs() | Document | ||
getOption($key, $default) | Document | ||
getOptions() | Document | ||
getPrinter() | Document | ||
getVars() | Document | Get the variables available for import | |
hasLogs($flag) | Document | ||
import($_FILENAME, $_VARS, $_KEY) | Document | Import (require) a PHP/phtml file as a sub-template, capturing its output. | |
isImportValid($filename) | Document | ||
isRaw() | Document | ||
jsonSerialize() | Document | ||
logEvent($event) | Document | Record a log/event on this document, e.g. | |
offsetExists($offset) | Document | ArrayAccess: isset($document[$offset]) -- true for a body entry with a non-null value, or, when the body is a plain array, for any existing key (including one whose value is null). | |
offsetGet($offset) | Document | ArrayAccess: $document[$offset] -- returns null for a missing entry, same as `$document[$offset] ?? | |
offsetSet($offset, $value) | Document | ArrayAccess: $document[$offset] = $value sets a body entry ($document[] = $value appends). | |
offsetUnset($offset) | Document | ArrayAccess: unset($document[$offset]) removes a body entry. | |
Raw($body, $opts) | Document | Build a document whose isRaw is true from the start (see setRaw for what "raw" means). | |
removeLink($link) | Document | Remove a link (by identity). | |
renderValue($value, $opts) | Document | Render an arbitrary value through this document's printer (getPrinter, or TextPrinter by default), merging $opts over the document's own options. | |
setBody($body) | Document | Replace the document's content, then dispatch DocumentInit. | |
setImportPaths($paths) | Document | Replace the base directories searched by findImportPath/import for a relative filename. | |
setLogs($logs) | Document | ||
setOption($key, $value) | Document | Set (or, with a null $value, remove) a single option. | |
setOptions($opts) | Document | Replace the whole options bag. | |
setPrinter($printer) | Document | ||
setRaw($raw) | Document | Tells a document should be left as raw as possible. | |
setVars($vars) | Document | Replace the variables made available to import()-ed files (a 'document' => $this var is always added at construction, see __construct). | |
startCapture($key) | Document | Start output capture. | |
__construct($body, $opts) | Document | Constructor | |
__toString() | Document |