module shop, flash message
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user