Validation within a Symfony Bundle

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

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *