FormRender
in package
FinalYes
Render options of a complete form (form-runtime.md, "Complete form"): the form element, the hidden fields, form errors and node errors.
Table of Contents
Constants
- EMPTY : mixed = ['form' => null, 'hidden' => [], 'formErrors' =...
- The model of empty options: the crudui-form block alone.
- ACTION_MEMBERS : mixed = ['method', 'url', 'enctype']
- MEMBERS : mixed = ['action', 'hidden', 'formErrors', 'errors']
Methods
-
model()
: array{form: ?array
, hidden: list , formErrors: list , nodeErrors: array >} - Check render options and build the model the renderer writes.
- failure() : FormError
- invalidAction() : bool
- members() : array<string|int, mixed>|null
- The members of a JSON object: a stdClass, an associative array or an empty array.
- nodesByPath() : void
- Every node with a data path, by that path: a row's path is its collection path, `.` and its key.
Constants
EMPTY
The model of empty options: the crudui-form block alone.
public
mixed
EMPTY
= ['form' => null, 'hidden' => [], 'formErrors' => [], 'nodeErrors' => []]
ACTION_MEMBERS
private
mixed
ACTION_MEMBERS
= ['method', 'url', 'enctype']
MEMBERS
private
mixed
MEMBERS
= ['action', 'hidden', 'formErrors', 'errors']
Methods
model()
Check render options and build the model the renderer writes.
public
static model(array<int, stdClass> $nodes, mixed $templateAction, mixed $options) : array{form: ?array, hidden: list, formErrors: list, nodeErrors: array>}
Parameters
- $nodes : array<int, stdClass>
-
top-level nodes that the renderer writes
- $templateAction : mixed
- $options : mixed
Tags
Return values
array{form: ?arrayfailure()
private
static failure(string $message) : FormError
Parameters
- $message : string
Return values
FormErrorinvalidAction()
private
static invalidAction(array<string|int, mixed> $action) : bool
Parameters
- $action : array<string|int, mixed>
Return values
boolmembers()
The members of a JSON object: a stdClass, an associative array or an empty array.
private
static members(mixed $value) : array<string|int, mixed>|null
Parameters
- $value : mixed
Return values
array<string|int, mixed>|nullnodesByPath()
Every node with a data path, by that path: a row's path is its collection path, `.` and its key.
private
static nodesByPath(array<string|int, mixed> $nodes, string|null $parent, array<string, stdClass> &$out) : void
Parameters
- $nodes : array<string|int, mixed>
- $parent : string|null
- $out : array<string, stdClass>