Validation within a Symfony Bundle

  bundle, php, symfony, validation

How do you implement the Symfony validator inside a bundle that you created?

I have an Extension class, a CompilerPass and a ‘services.xml’ file.

The validator is supposed to be injected in a middleware, and I tried in my Extension using:
$container->registerForAutoConfiguration(ValidatorInterface::class)->addTag(...);
but if I try finding the tag and dumping the key in my CompilerPass, then it claims I’ve requested an undefined service.

Source: Symfony Questions

LEAVE A COMMENT