- Filling values of context if vars exists within it

This commit is contained in:
Dave Mc Nicoll 2024-06-04 13:34:31 +00:00
parent 0a7b1cdc12
commit 1991122c32
1 changed files with 11 additions and 0 deletions

View File

@ -51,6 +51,8 @@ class FormContext implements FormContextInterface
}
}
$this->fillValues();
$this->files = $request->getUploadedFiles() ?: [];
}
@ -142,4 +144,13 @@ class FormContext implements FormContextInterface
{
$this->messages[] = $message;
}
protected function fillValues() : void
{
foreach($this->values as $property => $value) {
if (property_exists($this, $property)) {
$this->$property = $value;
}
}
}
}