flash, middleware

This commit is contained in:
2024-10-17 14:55:00 +03:00
parent c3c377a4e2
commit 4355651695
22 changed files with 226 additions and 75 deletions

View File

@ -42,7 +42,7 @@ class FormModel
public function getItem(string $name)
{
if (isset($this->data[$name])){
if (isset($this->data[$name])) {
return $this->data[$name];
}
@ -64,4 +64,19 @@ class FormModel
return $this->validator->getProcessedErrors();
}
public function getErrorsStr(): string
{
$errorsArr = $this->getErrors();
$str = '';
if ($errorsArr['errors']) {
foreach ($errorsArr['errors'] as $key => $errorArr) {
foreach ($errorsArr['errors'][$key] as $error){
$str .= "$error <br>";
}
}
}
return $str;
}
}