I am trying to use the FOSUserBundle validators in my own form, but I do not know how to configure validator.yml. Currently, it looks like this:
Acme\UserBundle\Entity\User: constraints: - FOS\UserBundle\Validator\Unique: property: usernameCanonical - FOS\UserBundle\Validator\Unique: property: emailCanonical properties: username: - NotBlank: ~ email: - Email: ~ - NotBlank: ~ mandant: - NotBlank: ~ - Type: Acme\UserBundle\Entity\Mandant
But this leads to the following PHP error:
[05-Mar-2012 14:47:56 UTC] PHP Stack trace: [05-Mar-2012 14:47:56 UTC] PHP 1. {main}() W:\redacted\symfony_webfrontend\app\console:0 [05-Mar-2012 14:48:10 UTC] PHP Fatal error: Class 'FOS\UserBundle\ValidatorUnique' not found in W:\redacted\symfony_webfrontend\vendor\symfony\src\Symfony\Component\Validator\Mapping\Loader\FileLoader.php on line 73
It seems that the class path is wrong, but I cannot find documentation on how to use the validators of another package in my own validators.yml ...
source share