Backend\Classes\FormWidgetBase

Overview

FormWidgetBase class contains widgets used specifically for forms

Extends

Public Properties

public October\Rain\Database\Model $model

model object for the form.

public array $data

data containing field values, if none supplied model should be used.

public string $sessionKey

sessionKey for the active session, used for editing forms and deferred bindings.

public string $sessionKeySuffix

sessionKeySuffix adds some extra uniqueness to the session key.

public bool $previewMode

previewMode renders this form with uneditable preview data.

public bool $showLabels

showLabels determines if this form field should display comments and labels.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected FormField $formField

formField object containing general form field information.

protected Backend\Widgets\Form $parentForm

The parent form that contains this field

protected string $fieldName

protected string $valueFrom

Model attribute to get/set value from.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public __construct()

public __construct(
    Controller $controller,
    FormField $formField,
    array $configuration = []
): void

public getFieldName()

public getFieldName(): string 

getFieldName returns the HTML element field name for this widget, used for capturing user input, passed back to the getSaveValue method when saving.

public getId()

public getId($suffix = null): void

getId returns a unique ID for this widget. Useful in creating HTML markup.

public getLoadValue()

public getLoadValue(): string 

getLoadValue returns the value for this form field, supports nesting via HTML array.

public getParentForm()

public getParentForm(): Backend\Widgets\Form|null 

getParentForm retrieves the parent form for this formwidget

public getSaveValue()

public getSaveValue(mixed $value): string 

getSaveValue processes the postback value for this widget. If the value is omitted from postback data, the form widget will be skipped.

public getSessionKey()

public getSessionKey(): string 

getSessionKey returns the active session key, including suffix.

public resetFormValue()

public resetFormValue(): void

resetFormValue from the form field, triggered by the parent form calling setFormValues and the new value is in the formField object value property.

Show inherited public methods

Inherited Public Methods

Protected Methods

Show inherited protected methods

Inherited Protected Methods