Widget
in package
FinalYes
Evaluate field controls without generating HTML.
Table of Contents
Constants
- KINDS : mixed = ['text' => 'text', 'string' => 'text', 'email'...
- MEMBERS : mixed = ['kind', 'layout', 'tag', 'attrs', 'text', 'raw...
- Widget model members in their output order (docs/spec/form-runtime.md).
Properties
- $design : stdClass
- $id : string
- $language : string
- $name : string
- $options : array<string|int, mixed>
- $path : string
- $rows : array<string|int, mixed>
- $spec : stdClass
- $value : mixed
Methods
- evaluate() : stdClass
- Evaluate a supported widget model or report its unsupported field type.
- __construct() : mixed
- affix() : mixed
- affixes() : array<string|int, mixed>
- behavior() : array<string|int, mixed>
- button() : stdClass
- A button element with the content text; behavior scripts are its event attributes.
- choices() : stdClass
- condition() : stdClass
- A condition field: a textarea holding the condition text of its tree, marked for the browser bindings that decode it (docs/spec/form-markup.md, Condition fields).
- data() : array<string|int, mixed>
- display() : stdClass
- displayValue() : string
- dynamic() : bool
- editor() : stdClass
- file() : stdClass
- input() : stdClass
- items() : array<string|int, mixed>
- js() : string
- json() : string
- JSON text as JSON.stringify writes it, each number as Numbers::string writes it.
- main() : string
- model() : stdClass
- opt() : string|null
- options() : array<string|int, mixed>
- placeholder() : array<string|int, mixed>
- placeholderOption() : object
- The one option of a select or search field with no option: value '' and the untranslated text select (CUSC-080).
- range() : stdClass
- A range input with the bounds and the step of its required validate.range and validate.step; compilation has checked them.
- select() : stdClass
- source() : stdClass
- style() : array<string|int, mixed>
- t() : string
- textarea() : stdClass
Constants
KINDS
private
mixed
KINDS
= ['text' => 'text', 'string' => 'text', 'email' => 'email', 'number' => 'number', 'integer' => 'number', 'float' => 'number', 'decimal' => 'number', 'range' => 'range', 'password' => 'password', 'textarea' => 'textarea', 'condition' => 'condition', 'select' => 'select', 'dropdown' => 'select', 'selectbox' => 'select', 'hidden' => 'hidden', 'choice' => 'choice', 'radio' => 'choice', 'multichoice' => 'multichoice', 'checkboxes' => 'multichoice', 'checkcontainer' => 'multichoice', 'date' => 'date', 'datetime' => 'datetime', 'datetime-local' => 'datetime', 'dummy' => 'dummy', 'html' => 'dummy', 'static' => 'dummy', 'dummy-input' => 'dummy-input', 'image' => 'image', 'file' => 'file', 'cover' => 'cover', 'cover-simple' => 'cover', 'image-viewer' => 'image-viewer', 'search' => 'search', 'autocomplete' => 'search', 'tinymce' => 'tinymce', 'wysiwyg' => 'tinymce', 'summernote' => 'summernote', 'editorjs' => 'editorjs', 'tui' => 'tui', 'button' => 'button', 'action' => 'button', 'tagify' => 'tagify', 'tagify2' => 'tagify2']
MEMBERS
Widget model members in their output order (docs/spec/form-runtime.md).
private
mixed
MEMBERS
= ['kind', 'layout', 'tag', 'attrs', 'text', 'rawHtml', 'source', 'options', 'itemLabelClass', 'script', 'styleChrome', 'prepend', 'append', 'extra', 'condition']
Properties
$design
private
stdClass
$design
$id
private
string
$id
$language
private
string
$language
$name
private
string
$name
$options
private
array<string|int, mixed>
$options
$path
private
string
$path
$rows
private
array<string|int, mixed>
$rows
$spec
private
stdClass
$spec
$value
private
mixed
$value
Methods
evaluate()
Evaluate a supported widget model or report its unsupported field type.
public
static evaluate(stdClass $spec, mixed $value, string $path, stdClass $design, array<string|int, mixed> $options, array<string|int, mixed> $rows) : stdClass
Parameters
- $spec : stdClass
- $value : mixed
- $path : string
- $design : stdClass
- $options : array<string|int, mixed>
- $rows : array<string|int, mixed>
Return values
stdClass__construct()
private
__construct(stdClass $spec, mixed $value, string $path, stdClass $design, array<string|int, mixed> $options, array<string|int, mixed> $rows) : mixed
Parameters
- $spec : stdClass
- $value : mixed
- $path : string
- $design : stdClass
- $options : array<string|int, mixed>
- $rows : array<string|int, mixed>
affix()
private
affix(string $kind) : mixed
Parameters
- $kind : string
affixes()
private
affixes() : array<string|int, mixed>
Return values
array<string|int, mixed>behavior()
private
behavior() : array<string|int, mixed>
Return values
array<string|int, mixed>button()
A button element with the content text; behavior scripts are its event attributes.
private
button() : stdClass
Return values
stdClasschoices()
private
choices(string $kind) : stdClass
Parameters
- $kind : string
Return values
stdClasscondition()
A condition field: a textarea holding the condition text of its tree, marked for the browser bindings that decode it (docs/spec/form-markup.md, Condition fields).
private
condition() : stdClass
Return values
stdClassdata()
private
data() : array<string|int, mixed>
Return values
array<string|int, mixed>display()
private
display(string $kind) : stdClass
Parameters
- $kind : string
Return values
stdClassdisplayValue()
private
displayValue() : string
Return values
stringdynamic()
private
dynamic() : bool
Return values
booleditor()
private
editor(string $kind) : stdClass
Parameters
- $kind : string
Return values
stdClassfile()
private
file(string $kind) : stdClass
Parameters
- $kind : string
Return values
stdClassinput()
private
input(string $kind) : stdClass
Parameters
- $kind : string
Return values
stdClassitems()
private
items() : array<string|int, mixed>
Return values
array<string|int, mixed>js()
private
static js(string $value) : string
Parameters
- $value : string
Return values
stringjson()
JSON text as JSON.stringify writes it, each number as Numbers::string writes it.
private
static json(mixed $value) : string
Parameters
- $value : mixed
Return values
stringmain()
private
main(string $base) : string
Parameters
- $base : string
Return values
stringmodel()
private
model(string $kind, string $layout, array<string|int, mixed> $attrs[, array<string|int, mixed> $extra = [] ]) : stdClass
Parameters
- $kind : string
- $layout : string
- $attrs : array<string|int, mixed>
- $extra : array<string|int, mixed> = []
Return values
stdClassopt()
private
opt(string $key[, string|null $default = null ]) : string|null
Parameters
- $key : string
- $default : string|null = null
Return values
string|nulloptions()
private
options([bool $choice = false ]) : array<string|int, mixed>
Parameters
- $choice : bool = false
Return values
array<string|int, mixed>placeholder()
private
placeholder() : array<string|int, mixed>
Return values
array<string|int, mixed>placeholderOption()
The one option of a select or search field with no option: value '' and the untranslated text select (CUSC-080).
private
static placeholderOption() : object
Return values
objectrange()
A range input with the bounds and the step of its required validate.range and validate.step; compilation has checked them.
private
range() : stdClass
Return values
stdClassselect()
private
select(string $kind) : stdClass
Parameters
- $kind : string
Return values
stdClasssource()
private
source() : stdClass
Return values
stdClassstyle()
private
style() : array<string|int, mixed>
Return values
array<string|int, mixed>t()
private
t(mixed $value) : string
Parameters
- $value : mixed
Return values
stringtextarea()
private
textarea() : stdClass