FieldSchema
Corex\Forms\Schema\FieldSchema · class · Forms layer
A normalized, immutable form field. Beyond the canonical name, input type, label, ordered rule list, and required flag, it carries the presentation knobs a flexible form needs: choice options (select/radio/checkbox groups), the label display mode, an optional column width, extra CSS classes, and extra HTML attributes. All of the presentation fields default to sensible values so a minimal ['rules' => [...]] definition still resolves.
Public API
Section titled “Public API”__construct(string $name, string $type, string $label, array $rules, bool $required, array $options, string $labelMode, string $width, string $cssClass, array $attrs, string $placeholder, string $helpText, mixed $defaultValue, string $visibility, string $stepKey, string $personalDataClass, array $extensionConfig)
Section titled “__construct(string $name, string $type, string $label, array $rules, bool $required, array $options, string $labelMode, string $width, string $cssClass, array $attrs, string $placeholder, string $helpText, mixed $defaultValue, string $visibility, string $stepKey, string $personalDataClass, array $extensionConfig)”Exception to the “≤4 constructor parameters” rule (Clean Code Ch. 3): this is an immutable value object whose parameters are independent, named, fully-defaulted presentation attributes — not collaborators. Grouping them into a sub-object would add indirection without removing knowledge, so they stay as named readonly promoted properties (the resolver builds them with named arguments).
isChoice(): bool
Section titled “isChoice(): bool”Whether this type renders a set of choices (and therefore needs options).
takesSeveralAnswers(): bool
Section titled “takesSeveralAnswers(): bool”Whether the answer to this field is a list: every option ticked or selected, not one of them.