Skip to content
docsv0.17.0

FormBinder

Binds raw (typically all-string) input against a FormDefinition: coerces each value to the field's base type per the frozen contract, validates against the field's constraints, and returns a FormSubmission with normalized values for EVERY field (typed where valid, raw-or-null otherwise) and a per-field ValidationResult. It never dispatches.

FormBinder::bind()

public function bind(Milpa\Live\Schema\FormDefinition $definition, array $rawValues): Milpa\Live\Schema\FormSubmission

Binds raw input against a FormDefinition and returns a typed, validated FormSubmission.

Parameters

Parameters of bind()
NameTypeDescription
$definitionMilpa\Live\Schema\FormDefinition
$rawValuesarray<string, mixed>