CRUDUI PHP API

Application

Table of Contents

Interfaces

FileLoader
File loader for $ref resolution. Port of validator-ts/src/compose/loader.ts.
RuleInterface
Interface for validation rules.

Classes

Form
Editable data and evaluated fields for one compiled structure.
FormError
Report a generation failure with its stable code and field path.
Generator
Compile form structures, bind values and render forms or lists.
Binding
Bind compiled fields to data as nodes of the recursive form grammar.
Buttons
Form buttons: the actions a spec declares with root buttons, rendered in the form footer.
ChoiceList
Read choice lists: `items` arrays of value and label pairs kept in list order.
Dates
Parse supported date strings for UTC control and list display.
Design
Evaluate visibility and appearance with the shared expression engine and visibility rule.
Details
Compose detail declarations and render one supplied record read-only.
DisplayDeclaration
Declaration rules of composed list and detail specifications (docs/spec/display-formats.md).
FormRender
Render options of a complete form (form-runtime.md, "Complete form"): the form element, the hidden fields, form errors and node errors.
History
The undo history rules of form instances (CURT-062, CURT-063, CURT-076 to CURT-080), as pure functions. A history is an object with the lists `entries` and `redoEntries` and, after a value edit, the string `lastPath`; no function changes its argument.
InputText
Input text and value limit checks of the generator operations (docs/spec/input-text.md).
Lists
Compose list declarations, evaluate supplied rows and render table or card HTML.
Messages
Runtime interface text shared by every renderer and implementation.
Numbers
Decimal display of binary64 values.
Outline
The structure map model derived from evaluated nodes: one entry per form row.
Rendering
Serialize evaluated form models as HTML.
Style
Parse CSS declarations without splitting quoted or nested values.
Template
Compose field structures independently of instance data.
Value
Preserve JSON values and resolve form paths and presentation strings.
View
Row view state of form instances, kept outside the record data.
Widget
Evaluate field controls without generating HTML.
Compose
Composition orchestrator (SPEC §5, G5) — the parser's FIRST pass.
ComposeLoadError
Specification composition failure before form generation or validation.
Members
The member rules that $ref, $patch and the composition orchestrator share: the layering of the members of one node, the shallow merge and the plain-object test (SPEC §5).
MemoryLoader
In-memory loader over a fixed { key: doc } map. Port of the JS MemoryLoader.
Patch
$patch application — add / remove / replace over the $ref base (SPEC §5).
Ref
$ref resolution expands base inheritance before other composition (SPEC §5).
BinaryNode
Binary operation: logical (&& ||) or comparison (== != > >= < <=).
ConditionalValue
The value a conditional parameter resolves to in a row context: a condition map selects the value of its first matching condition, else its `true` default, else null (a condition that cannot be evaluated does not match); a ternary resolves to its branch value and stays the literal string when it cannot be evaluated; a valid condition expression resolves to its value, or false when it cannot be evaluated; any other string, and any other value, is a literal.
ConditionMap
Condition-map resolver (expressions.md §8). A thin wrapper over the expression engine — NOT a separate parser.
Evaluator
CRUDUI expression evaluator (expressions.md §5/§6/§7, JS PathResolver parity).
Expression
Public facade for the CRUDUI expression engine: string → tokens → AST → value.
FieldPath
The data path of the value a rule validates, with the positions of its row keys, so a relative field reference treats a row as one level (expressions.md, "Evaluation").
GroupNode
Parenthesized group wrapping an inner expression. A group parses only down to the or-level (JS parity): a bare ternary inside parentheses is rejected.
InNode
Membership test: value [not] in list. `list` is a Literal-node array; whether the source used brackets ([a,b]) or not (a,b) is NOT preserved in the AST.
Lexer
CRUDUI expression lexer (expressions.md §1, JS Lexer parity).
LiteralNode
Literal value. valueType is one of string|number|boolean|null. An unquoted identifier on a comparison right-hand side or in an `in` list is a string literal whose value is the identifier text (e.g. `.country == US` → 'US').
Node
Base for every CRUDUI expression AST node (expressions.md §4).
ParseError
Raised by Lexer/Parser on malformed input. Carries the human message only; the cross-language contract compares tokens/AST/values for VALID expressions, so error position detail is intentionally not part of the fixture surface.
Parser
CRUDUI expression parser: Token[] -> AST (expressions.md §3/§4, JS Parser parity).
PathNode
Path reference. relative=false → resolved from the data root; relative=true → resolved from parentPath (currentPath minus the field name) with levelsUp additional parent ascents. segments are identifier|wildcard|index.
PathSegment
A single path segment: identifier (field name), wildcard (*), or index (numeric array index). The index value serializes as a number to match the JS reference's segment shape ({type:'index', value:number}).
TernaryNode
Ternary conditional: condition ? trueValue : falseValue.
Token
A single lexical token. `value` is the raw source text; `literal` is the parsed value for value tokens (string content, number int/float, bool, null, or the dot count for DOT_DOT) and null otherwise.
UnaryNode
Unary logical negation: ! operand.
Visibility
`design.show` resolves like a conditional parameter in the field's row context ({@see ConditionalValue}), and only a resolved `false` hides the field: a field without `design.show`, a condition map that selects nothing and a string that is not a valid expression leave it visible. The validator and the form both use this resolution, so a server reaches the visibility the form showed.
FieldSpec
CRUDUI canonical FieldSpec model. SINGLE SOURCE OF TRUTH (SPEC §3).
ForbiddenScan
Recursive forbidden meta-key scan (SPEC §6) — the runtime half of the global rejection that the meta-schema's `propertyNames` enforces statically.
Validator
Compose specifications and validate submitted data or list declarations.
Accept
Accept validation rule.
BoundFrom
The bound of the minFrom and maxFrom rules (CUVR-079): a finite number value against the value of the referenced field; a missing or null bound declares none, and a boolean is no number.
ConditionTree
Condition tree: a value passes when it is a group `{all: [...]}` or `{any: [...]}`, a field comparison `{field, op, value}` or, under the parameter `judge`, a judged text `{judge}`, at most 32 levels deep (schema.md, "Condition trees"). A JSON object is a stdClass or a non-empty associative array, a list a list array. The check reads no level below the limit.
ContainedIn
Contained In validation rule (CUVR-075).
CountRule
A rule on the count of the value (array elements, object keys, 0 for a missing or blank value, 1 for another scalar), which is its measure.
Date
Date validation rule.
DateISO
ISO Date validation rule.
Digits
Digits: a string or number whose canonical text (a string trimmed) is ASCII digits passes.
Email
Email format validation rule.
EndDate
End Date validation rule.
EqualTo
Equal To validation rule.
FlagRule
A rule whose parameter is a boolean flag: the flag false switches the rule off, and with the flag on the rule accepts or rejects the value.
In
Membership validation rule: the value is one of the declared members.
LengthRule
A rule on the length of the canonical text of the value in code points, which is its measure: an array or object value has none.
Max
Inclusive upper bound: a numeric value not above the bound passes; any other value fails.
MaxCount
Maximum collection size: array elements, object keys, 0 for a missing or blank value, 1 for another scalar.
MaxFrom
Max From validation rule (CUVR-079).
MaxLength
Maximum length validation rule on the code points of the canonical text.
MeasuredRule
A rule on a measure of the value (its number, its length or its count): a value without a measure fails, and the rule decides for a measure.
Min
Inclusive lower bound: a numeric value not below the bound passes; any other value fails.
MinCount
Minimum collection size: array elements, object keys, 0 for a missing or blank value, 1 for another scalar.
MinFrom
Min From validation rule (CUVR-079).
MinLength
Minimum length validation rule on the code points of the canonical text.
NotEqual
Not Equal validation rule.
Number
Number: a numeric value passes; any other value fails.
NumericRule
A rule on the numeric value of the value, which is its measure.
ParameterRule
A rule with a parameter: the rule reads and checks the parameter first, so a parameter outside the validation rules fails before the value is looked at, and then decides whether the value holds.
Pattern
Whole-value pattern rule, registered as both `pattern` and `match`.
Range
Inclusive numeric range: a numeric value within [minimum, maximum] passes; any other value fails.
RangeLength
Range length validation rule on the code points of the canonical text.
ReferenceRule
A rule that compares a value with the value of another field: a missing or empty parameter switches it off, the parameter names the other field, and the rule itself compares the two.
Required
Required field validation rule: an empty value fails.
Step
Step: a numeric value that is an exact integer multiple of the step, counted from 0, passes; any other value fails.
StringRule
A rule on the text of a string: a parameter of false switches it off, a value that is not a string fails, and the string is accepted or not by the rule itself.
TypeFrom
Type From validation rule (CUVR-077).
Url
URL validation rule.
JsonText
Decode JSON text as json_decode($json, false, 512, JSON_THROW_ON_ERROR) does, keeping every string and member name as written (docs/spec/input-text.md). An unpaired surrogate escape becomes the three-byte encoding of that surrogate and a byte that is not UTF-8 is kept, so both remain text that is not valid UTF-8 and the input text check rejects them. Nothing is replaced.
JsonValue
Preserve JSON object and array types when accepting PHP values.
NumberValue
Parse decimal and radix strings using binary64 number conversion.
Text
Input text checks (docs/spec/input-text.md). Every string and object member name of a specification, a composition file and caller data is valid UTF-8, the PHP form of a sequence of Unicode scalar values. Invalid text is rejected before any other check of an operation; it is never replaced and never passed on.
DataLimits
The data limits of a form root (validation-rules.md, "Data limits"): the bounds of the levels and the nodes of the submitted data.
FormInputError
Submitted form data whose shape does not match the specification.
ListValidationResult
CRUDUI list-spec validation result — { valid, errors } (SPEC §9). Read sister of ValidationResult. A list carries no data (rows are injected, SPEC §9), so the four-language engine runs only compose + forbidden-scan: a clean structure load is always { valid:true, errors:[] }. A composition/forbidden-key failure is a LOAD failure (a thrown ComposeLoadError), NOT a valid:false result — so this shape is the clean-load companion, idempotent with the JS validateList return.
ValidationResult
CRUDUI validation result — { valid, errors, hidden } (SPEC G-B). Port of the JS ValidationResult shape. `errors` is a flat list of error records, each { path, field, rule, message, value }, identical in every runtime so the 4-language fixture compares bit-for-bit.
Validator
CRUDUI form validator — SPEC §2 G5→§3→§2 G1. Port of validator-ts/src/validate/validator.ts (Validator), function-for-function.

Enums

Missing
Represent an absent value separately from explicit null.
TokenType
Token type tags (expressions.md §1, JS types.ts TokenType parity).
On this page

Search results