Skip to content

Field decorators

Decorate entry field values for display — markdown, HTML, and type decorators.

Field decorators transform raw stored values into display-ready output. Call $entry->decorate() to apply type-specific decorators registered on field types.

When to use decorators

Use decorators in views when you need formatted output (rendered markdown, humanized dates) without mutating the stored value.

Basic usage

$html = $entry->decorate('body');

Each field type may register a decorator that knows how to format its value. String fields with markdown configuration return parsed HTML through the decorator pipeline.

Protected fields

Fields marked protected: true are omitted from toArray() and toJson() but remain accessible on the entry object and through decorate() when authorized.

{ "handle": "internal_notes", "type": "string", "protected": true }

Related