Textformatter class
A simple module type that provides formatting of text fields.
Please see the base Module
interface for all potential methods that a Textformatter module can have.
There are 5 Textformatter types in the core, plus many more Textformatters in the modules directory.
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the Textformatter
class also inherits all the methods and properties of: WireData and Wire.
Common
Name | Return | Summary | |
---|---|---|---|
Textformatter::format() Textformatter::format(string $str) Textformatter::format(string $str) | None | Format the given text string, outside of specific Page or Field context. | |
Textformatter::formatValue() Textformatter::formatValue(Page $page, Field $field, $value) Textformatter::formatValue(Page $page, Field $field, $value) | None | Format the given text string with Page and Field provided. | |
Textformatter::install() Textformatter::install() Textformatter::install() | None | Perform any installation procedures specific to this module, if needed. | |
Textformatter::uninstall() Textformatter::uninstall() Textformatter::uninstall() | None | Perform any uninstall procedures specific to this module, if needed. |
Additional methods and properties
In addition to the methods and properties above, Textformatter also inherits the methods and properties of these classes:
Core Textformatter types
Type | Summary |
---|---|
TextformatterEntities | Entity encode ampersands, quotes (single and double) and greater-than/less-than signs using htmlspecialchars(str, ENT_QUOTES). It is recommended that you use this on all text/textarea fields except those using a rich text editor or a markup language like Markdown. |
TextformatterMarkdownExtra | Markdown/Parsedown extra lightweight markup language by Emanuil Rusev. Based on Markdown by John Gruber. |
API reference based on ProcessWire core version 3.0.251