module shop, flash message

This commit is contained in:
2024-10-16 17:54:33 +03:00
parent 209b1e3f29
commit 9af44ca95f
12 changed files with 137 additions and 54 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;
}
}