symfony: [Validation] Doesn't override properly
I want to override the FOSUserBundle validation.xml so I created a new bundle which extends the FOSUserBundle:
public function getParent()
{
return 'FOSUserBundle';
}
But the validation.xml of the FOSUserBundle is still loaded.
I think the Validation component should respect the bundle inheritance.
About this issue
- Original URL
- State: closed
- Created 12 years ago
- Comments: 20 (10 by maintainers)
I don’t need username for registration and my solution is:
Set your own validation groups for FOSUserBundle registration and profile (eventualy for Group) form in config:
Completly redefine validations for FOSUserBundle registration with own registrations groups without username:
It works fine for me.
the validation component will load the validation.xml file for every bundle (if the file exists). And each bundle can provide validation rules for the classes it wants (AcmeDemoBundle could provide rules for classes of FOSUserBundle, FrameworkBundle and AcmeHelloBundle for instance). There is no mapping between the XML file in which rules are defined and the class.