We have an application built on top of Codeigniter (don't ask me why CI, it is what it is) and have recently started using more Symfony components to prepare the application for a total port to Symfony someday in the future.

I have successfully gotten Symfony Form to work with the project as well as the Symfony Validator. I've gotten around writing my own validation constraints and this can be done easily enough even without the symfony framework until you get to a point where you need to inject a dependency (such as the doctrine entityManager) into the validator. According to this awesome cookbook http://symfony.com/doc/current/cookbook ... raint.html , this can be done like so:

Constraint Validators with Dependencies¶If your constraint validator has dependencies, such as a database connection, it will need to be configured as a service in the dependency injection container. This service must include the validator.constraint_validator tag and an alias attribute:

We obviously don't have the DI container that symfony has but we have been using Pimple as our DI container. Can't figure out how to do this properly. Right now I got the entity manager injected into the validator by making use of the CI_instance and one of our bootstrap classes.