[CORE][Form] Remove unweildy return of form errors from Form::handle
This commit is contained in:
parent
8433771465
commit
5c708af272
|
@ -163,15 +163,7 @@ abstract class Form
|
|||
|
||||
$form->handleRequest($request);
|
||||
if ($request->getMethod() === 'POST' && $form->isSubmitted()) {
|
||||
if (!$form->isValid()) {
|
||||
$errors = [];
|
||||
foreach ($form->all() as $child) {
|
||||
if (!$child->isValid()) {
|
||||
$errors[$child->getName()] = (string) $form[$child->getName()]->getErrors();
|
||||
}
|
||||
}
|
||||
return $errors;
|
||||
} else {
|
||||
if ($form->isValid()) {
|
||||
$data = $form->getData();
|
||||
if (\is_null($target)) {
|
||||
return $data;
|
||||
|
|
Loading…
Reference in New Issue
Block a user