Backend\FormWidgets\RichEditor

Overview

RichEditor renders a rich content editor field.

Extends

Public Properties

public bool $fullPage

Determines whether content has HEAD and HTML tags.

public bool $toolbarButtons

Determines whether content has HEAD and HTML tags.

public bool $readOnly

If true, the editor is set to read-only mode

public bool $legacyMode

The Legacy mode disables the Vue integration.

public bool $showMargins

showMargins includes resizable document margins. Only works in Vue applications and form document layouts.

public bool $useLineBreaks

useLineBreaks uses line breaks instead of paragraph wrappers for each new line.

public string $externalToolbarAppState

Defines a mount point for the editor toolbar. Must include a module name that exports the Vue application and a state element name. Format: stateElementName Only works in Vue applications and form document layouts.

public array|null $editorOptions

editorOptions configured in the Froala editor. For example:

  • imageDefaultWidth: Sets the default width of the image when it is inserted in the rich text editor. Setting it to 0 will not set any width.
  • imageDefaultAlign: Sets the default image alignment when it is inserted in the rich text editor. Possible values are left, center and right.
  • imageDefaultDisplay: Sets the default display for an image when is is inserted in the rich text. Possible options are: inline and block.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected $defaultAlias

defaultAlias to identify this widget.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public init()

public init(): void

init the widget, called by the constructor and free from its parameters.

public prepareVars()

public prepareVars(): void

prepareVars for display

public render()

public render(): void

render the widget's primary contents.

Show inherited public methods

Inherited Public Methods

Protected Methods

protected evalToolbarButtons()

protected evalToolbarButtons(): string 

evalToolbarButtons to use based on config.

protected getValidEditorLang()

protected getValidEditorLang(): string|null 

getValidEditorLang returns a proposed language code for Froala.

protected getValidEditorOptions()

protected getValidEditorOptions(): array 

getValidEditorOptions returns custom editor options passed directly to the JS control

protected loadAssets()

protected loadAssets(): void

loadAssets adds widget specific asset files. Use $this->addJs() and $this->addCss() to register new assets to include on the page.

Show inherited protected methods

Inherited Protected Methods