Closed hhamon closed 5 years ago
so far the only "custom" validator i needed was for handling unique usernames in FOSUserBundle, but I can totally see myself needing the above and its probably good not to overburden the Validation component with all too many validators.
I also imagine that the vespolina project could have a use for these .. @iampersistent, @merk .. ?
Sounds like a good idea to me, though should it just be limited to validator components? What about custom form types?
@merk This is a different topic and should IMO stay a different bundle (which already exists BTW)
I dont know..
If we're talking about providing FOS validators as part of a bundle, i dont see why things of 'similar' ilk cant be included like form extensions and other little helpers, should they arise?
Doesnt matter if they're all broken out though - its just a thought.
I would prefer to add useful validators to the component instead of a bundle.
I guess my concern is with the release cycle of the core component which is currently bound to Symfony2 itself.
@schmittjoh we can't add them to the core validation component as the goal is to store validation rules depending on the country. It's too specific that's why we have to move to a bundle.
There is already a bundle for Form stuff . simplethings/SimpleThingsFormExtraBundle which theese would fit nicely. Cant see the idea of creating this as a FOS bundle just because it can be done.
but that bundle from a quick skim doesnt have validators yet. plus form and validation are even a separate component in core.
@hhamon, really? I mean we have a money validator which also has such rules built-in. A postal code validator seems to be quite similar to me.
The release cycle is a different story, but we could always make a bundle which backports these validators for older releases.
@schmittjoh good catch, I forgot the money validator. We should ask @fabpot about the release process. As we want to add new validators, they can figure in next releases such as 2.1, 2.2...
To me the money validator is likely in core as a show case rather than as an indicator that its a good idea to place lots of high level validators into the component itself. what i do realize just now is that a Bundle might not be the right approach for the validators (same goes for form types), since it would make them Symfony2 "only" to some extend.
Imho the best would be the creation of a library for form-types/validators and then a single Bundle that exposes them as needed in Symfony2.
guess @bschussek is living the good life in spain, but maybe he wants to still comment?
@lsmith77 then we could just add them to the bundle not a big deal really :)
lets warm this topic up again https://twitter.com/#!/gimler/statuses/132033325194952704
cc @gimler
I think this is a good idea. As for the non-Symfony2 people - nothing prevents them from adding the bundle to their code too, as long as it is PSR-0 compliant.
Should we ever find out that we want these features in the core, we can still move them there.
i would prefer the way like twig was going twig-extensions so we should create a repository for the component
form-extensions validator-extensions
in this context i would also like to bring up https://github.com/rdohms/DMS-filter (still in its infancy .. but imho filtering should be an optional step before validation)
Ping, I'd like to see some kind of extended validator bundle that supplies additional validator rules. Did we ever determine if @fabpot wanted to have these rules in core?
i assume that this is not relevant anymore. if it is, please reopen
Hi all,
I was wondering if it would be a good idea to add a bundle containing extra validation assertions like the followings:
I have already written validators and unit tests for IBAN, VAT & RIB (= french bank account number).
Do you think it's a good idea to group basic validators like those in the same bundle?
Cheers,