PHPackages                             ex3v/formerrorsbundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. ex3v/formerrorsbundle

ActiveSymfony-bundle[Templating &amp; Views](/categories/templating)

ex3v/formerrorsbundle
=====================

A service and Twig method that displays all form errors on all levels.

v0.0.1(11y ago)118.8k5[3 issues](https://github.com/Ex3v/FormErrorsBundle/issues)MITPHP

Since Sep 17Pushed 8y ago3 watchersCompare

[ Source](https://github.com/Ex3v/FormErrorsBundle)[ Packagist](https://packagist.org/packages/ex3v/formerrorsbundle)[ RSS](/packages/ex3v-formerrorsbundle/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

FormErrorsBundle
================

[](#formerrorsbundle)

[![knpbundles.com](https://camo.githubusercontent.com/0890563bc10dc2de90a91673cdf9ffa8f7c45e0901880893770a767bd1d8c3e2/687474703a2f2f6b6e7062756e646c65732e636f6d2f457833762f466f726d4572726f727342756e646c652f6261646765)](http://knpbundles.com/Ex3v/FormErrorsBundle)

[![Latest Stable Version](https://camo.githubusercontent.com/1f037f28366d49603e418e53ce859f3bf88ae029d3879a8457cf43669436baf1/68747470733a2f2f706f7365722e707567782e6f72672f657833762f666f726d6572726f727362756e646c652f762f737461626c652e737667)](https://packagist.org/packages/ex3v/formerrorsbundle) [![Total Downloads](https://camo.githubusercontent.com/99417c4fb008c91a778baf07954b6319053cbf6a486e8e6dd5cf4640e3d373f5/68747470733a2f2f706f7365722e707567782e6f72672f657833762f666f726d6572726f727362756e646c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/ex3v/formerrorsbundle) [![License](https://camo.githubusercontent.com/9ecfa566dd03a3986a3176fd0568c574c450bb2a957a24b0c3d5f2ebca9b436a/68747470733a2f2f706f7365722e707567782e6f72672f657833762f666f726d6572726f727362756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/ex3v/formerrorsbundle)

This bundle contains two things:

- a service that exports all errors from form to array
- Twig extension that helps display them as list

There already is form method getErrorsAsString(), but it does not provide you with labels. It also requires you to write boilerplate code in controllers, or writing your own service. If you will try to list all errors by yourself, you will notice that $form-&gt;getErrors() returns errors only for Form itself, not for particular fields or subforms. Why bother creatng your own parser? Use mine :)

**DISCLAIMER**
--------------

[](#disclaimer)

I wrote this bundle basing on Symfony 2.3.13 for my own purposes, did not tested on other versions, but having in mind what Fabien said about backwards compatibility, it should work at least on 2.4 and any future relase of Symfony2, as well as on previous versions. Remember that I don't guarantee this, so feel free to test, fork and make your changes.

**INSTALLATION**
----------------

[](#installation)

- **Add this to *require* part of your composer.json file:**

    ```
      "ex3v/formerrorsbundle": "dev-master"

    ```
- **Add this to your AppKernel.php (under /app)**

    ```
      new Ex3v\FormErrorsBundle\Ex3vFormErrorsBundle(),

    ```

then run `composer update` on your project to install.

**USAGE**
---------

[](#usage)

While in controller, add not only FormView, but also Form object to returning array:

```
    return array(
        'form' => $form->createView(),
        'formFull' => $form
    );

```

Having this, you can call new method in Twig:

```
    {{ all_form_errors(formFull) }}

```

This method will (by default) display all of your form errors as &lt;ul&gt; list, like this:

```

         Title: field cannot be empty.
         Website: this is not a valid URL.

```

You can customize your output by adding additional parameters:

```
    {{ all_form_errors(formFull, "div", "myclass") }}

```

This will produce errors list in which each error is wrapped in separate div, having "myclass" as its class:

```

        Title: field cannot be empty.

        Website: this is not a valid URL.

```

If you want more control over your errors, you also can call service that parses errors directly in controller:

```
    $formErrorsParser = $this->get('formErrorsParser');
    $errors = $formErrorsParser->parseErrors($form);

```

$errors array will contain arrays composed of:

- field name
- field label
- Symfony\\Component\\Form\\FormError error object, that contains error message in two formats (original and translated) as well as field value.

Any suggestions or contributions are warmly welcome. Happy coding!

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance15

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community17

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4307d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2785665?v=4)[Maciej Szkamruk](/maintainers/Ex3v)[@Ex3v](https://github.com/Ex3v)

---

Top Contributors

[![Ex3v](https://avatars.githubusercontent.com/u/2785665?v=4)](https://github.com/Ex3v "Ex3v (18 commits)")[![crayner](https://avatars.githubusercontent.com/u/918953?v=4)](https://github.com/crayner "crayner (2 commits)")[![friartuck6000](https://avatars.githubusercontent.com/u/4365821?v=4)](https://github.com/friartuck6000 "friartuck6000 (1 commits)")[![k0pernikus](https://avatars.githubusercontent.com/u/436935?v=4)](https://github.com/k0pernikus "k0pernikus (1 commits)")[![orthographic-pedant](https://avatars.githubusercontent.com/u/14522744?v=4)](https://github.com/orthographic-pedant "orthographic-pedant (1 commits)")[![stas-p](https://avatars.githubusercontent.com/u/7312595?v=4)](https://github.com/stas-p "stas-p (1 commits)")

---

Tags

twigformtwig-extensionform-errors

### Embed Badge

![Health badge](/badges/ex3v-formerrorsbundle/health.svg)

```
[![Health](https://phpackages.com/badges/ex3v-formerrorsbundle/health.svg)](https://phpackages.com/packages/ex3v-formerrorsbundle)
```

###  Alternatives

[nucleos/antispam-bundle

This bundle provides some basic features to reduce spam in symfony forms.

52105.1k](/packages/nucleos-antispam-bundle)[dms/twig-extension-bundle

DMS Twig Extension Bundle, leverages Fabien Potencier's extra twig extensions for your website.

20297.4k](/packages/dms-twig-extension-bundle)[boekkooi/jquery-validation-bundle

Jquery form validation bundle for symfony 2

2774.0k1](/packages/boekkooi-jquery-validation-bundle)[bluetel-solutions/twig-truncate-extension

Twig Extension to truncate nested HTML, safely!

11103.5k](/packages/bluetel-solutions-twig-truncate-extension)[wapmorgan/morphos-twig

Adds a {{ plural }}, {{ name }}, {{ numeral }}, {{ ordinal }} and {{ money }} filters to Twig templating engine for Russian pluralization and declenation.

1032.6k](/packages/wapmorgan-morphos-twig)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
