1

Symfony2: Upgrading 2.0 to 2.1 – CallbackValidator

Posted November 12th, 2012 in Razno and tagged , , by Metod

The CallbackValidator class was deprecated in 2.1.

If you implemented custom validators using this interface, you can substitute them by event listeners listening to the FormEvents::POST_BIND (or any other of the *BIND events). In case you used the CallbackValidator class, you should now pass the callback directly to addEventListener.

Here is how you do it.

Before:

After:

Enjoy! 😉

One Response so far.

  1. Emilie says:

    Nice thank you! 🙂