FieldtypeTextarea
Stores multi-line text, optionally as HTML/Markup. Extends FieldtypeText.
string — multi-line text or HTML markup, or empty string '' when blank.
// Get
$page->body // string (formatted when output formatting is on)
$page->getUnformatted('body') // raw value, no Textformatters applied
// Set
$page->body = 'Some <b>HTML</b> content.';
$page->save('body');Supports the same operators as FieldtypeText (fulltext, LIKE, etc.):
$pages->find('body*=keyword'); // fulltext match
$pages->find('body%=keyword'); // LIKE match
$pages->find('body=""'); // no content// output formatting ON (default in front-end):
echo $page->body; // Textformatters applied, MarkupQA corrections applied for HTML
// output formatting OFF:
echo $page->getUnformatted('body'); // raw stored valueWhen contentType is set to HTML, the field automatically corrects href and src attributes
at save/load time so that URLs remain valid if the site moves to a different subdirectory or domain.
contentTypesetting:0=plain text (default),1=HTML/Markup,2=HTML with image management.inputfieldClasssetting: the Inputfield used for editing. Common values:InputfieldTextarea(default),InputfieldCKEditor,InputfieldTinyMCE.htmlOptionssetting: array of flags for HTML content type — link abstraction, image alt management, removing inaccessible images, lazy loading. Only relevant whencontentType >= 1.- Database column:
mediumtext NOT NULL, fulltext indexed. - Compatible fieldtypes: any fieldtype extending
FieldtypeText.
Properties set to $field that is using this type, acceessed by $field->get('property')
contentType(int): Content type of field output using a self::contentType* constant Default:0htmlOptions(array): Options for content-type Markup/HTML using self::html* constants Default:[]inputfieldClass(string): Inputfield class/module name to use for this field Default:InputfieldTextarea
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Fieldtype class also inherits all the methods and properties of: FieldtypeText, Fieldtype, WireData and Wire.
Common
Additional methods and properties
In addition to the methods and properties above, Fieldtype
API reference based on ProcessWire core version 3.0.261