Contents

Backend\FormWidgets\RichEditor

Overview

RichEditor renders a rich content editor field.

Extends
Implements
  • Larajax\Contracts\ViewComponentInterface

Public Properties

public bool $fullPage

Determines whether content has HEAD and HTML tags.

public string|array|null $toolbarButtons

toolbarButtons to display, used verbatim.

public string|null $toolbar

toolbar references a named toolbar definition by its code, registered via the registerRichEditorToolbars registration method.

public bool $readOnly

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

public bool $safeMode

safeMode sanitizes the value with Html::clean when it is rendered as HTML in preview 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 $externalToolbarBus

externalToolbarBus defines a mount point for the editor toolbar. 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(): array|null 

evalToolbarButtons resolves the button list from field config, where a named toolbar definition applies when no verbatim buttons are given

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