Backend\FormWidgets\TagList

Overview

Tag List Form Widget

Extends

Public Properties

public string $separator

separator for tags: space, comma.

public bool $customTags

customTags allowed to be entered manually by the user.

public mixed $options

options settings. Set to true to get from model.

public string $mode

mode for the return value. Values: string, array, relation.

public string $nameFrom

nameFrom if mode is relation, model column to use for the name reference.

public bool $useKey

useKey instead of value for saving and reading data.

public string $placeholder

placeholder for empty TagList widget

Show inherited public properties

Inherited Public Properties

Protected Properties

protected bool $useOptions

useOptions if they are supplied by the model or array

protected $defaultAlias

defaultAlias to identify this widget.

Show inherited protected properties

Inherited Protected Properties


Public Methods

public getFieldOptions()

public getFieldOptions(): array 

getFieldOptions returns defined field options, or from the relation if available.

public getLoadValue()

public getLoadValue(): void

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

public getPreviewOptions()

public getPreviewOptions($selectedValues, $availableOptions): array 

getPreviewOptions generates options for display in read only modes

public getSaveValue()

public getSaveValue($value): void

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

public init()

public init(): void

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

public nearestModelAttribute()

public nearestModelAttribute($attribute): void

public prepareVars()

public prepareVars(): void

prepareVars for display

public render()

public render(): void

render the widget's primary contents.

public resolveModelAttribute()

public resolveModelAttribute(string $attribute): array 

Returns the final model and attribute name of a nested HTML array attribute. Eg: [$model, $attribute] = $this->resolveModelAttribute($this->valueFrom);

Show inherited public methods

Inherited Public Methods

Protected Methods

protected getCustomSeparators()

protected getCustomSeparators(): mixed 

getCustomSeparators returns character(s) to use for separating keywords.

protected getFieldOptionsForRelation()

protected getFieldOptionsForRelation(): void

protected getLoadValueFromRelation()

protected getLoadValueFromRelation($names): void

protected getLoadValueFromString()

protected getLoadValueFromString($value): void

protected getRelationModel()

protected getRelationModel(): Relation 

Returns the model of a relation type, supports nesting via HTML array.

protected getRelationObject()

protected getRelationObject(): Relation 

Returns the value as a relation object from the model, supports nesting via HTML array.

protected getRelationQuery()

protected getRelationQuery(): void

protected getRelationType()

protected getRelationType(): string 

getRelationType returns the value as a relation type from the model, supports nesting via HTML array.

protected getSeparatorCharacter()

protected getSeparatorCharacter(): string 

getSeparatorCharacter convert the character word to the singular character.

protected isRelationTypeSingular()

protected isRelationTypeSingular(): bool 

isRelationTypeSingular checks if the related model is singular.

protected processMode()

protected processMode(): void

protected processSaveForRelation()

protected processSaveForRelation($names): void

protected processSaveForString()

protected processSaveForString($value): void

Show inherited protected methods

Inherited Protected Methods