title: How to configure dependencies on custom validator with Symfony Components?
body: <p>I am using <strong>Symfony Validator</strong> and <strong>Symfony Service Container</strong> in a project, but not the full Symfony Framework.</p>
  
  <p>I have written a custom validator that requires some dependencies to be supplied as constructor arguments.</p>
  
  <p>The <a href="http://symfony.com/doc/current/validation/custom_constraint.html#constraint-validators-with-dependencies" rel="nofollow noreferrer">Symfony Documentation</a> describes a method of configuring the validator as service, which I have done successfully. But then it makes of point of using the <code>validator.constraint_validator</code> <strong>service tag</strong>, which I suspect glues them together.</p>
  
  <p>This service tag seems to be specific to when using the full Symfony Framework -- Symfony Validator is not magically loading my custom validator when I add this tag (unsurprisingly.)</p>
  
  <p>So, how can I link the Validator and Service Container components? Or is there any other strategy for having Symfony Validator to load my customer validator with dependencies?</p>