Skip to content

Commit 6a5c14e

Browse files
committed
fix: fix form_all_errors_count Twig function
1 parent b057d0d commit 6a5c14e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/twig.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ You can return all form error as an array of errors with `form_all_errors`. Each
1313
{% set all_errors = form_all_errors(form) %}
1414
```
1515

16-
### form_error_count
16+
### form_all_errors_count
1717

1818
You can return the total number of errors in a form via `form_all_errors_count`.
1919

2020
```
21-
This form has {{ form_error_count(form) }} errors.
21+
This form has {{ form_all_errors_count(form) }} errors.
2222
```
2323

2424
### form_error_summary

src/Twig/AccessibleFormsExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public function allErrors(FormView $form): array
6969
return $errors;
7070
}
7171

72-
public function allErrorsCount(): int
72+
public function allErrorsCount(FormView $form): int
7373
{
74-
return count($this->allErrors());
74+
return count($this->allErrors($form));
7575
}
7676

7777
public function errorsSummary(FormView $form): string

0 commit comments

Comments
 (0)