fuel / validation

FuelPHP Framework - Data Validation library
70 stars 14 forks source link

Rule "collections" #41

Open emlynwest opened 10 years ago

emlynwest commented 10 years ago

Have some way of grouping sets of rules that means they can be easily loaded if needed in one go. This means that 3rd party rule sets can be more easily managed.

sagikazarmark commented 9 years ago

I have some similar idea in my mind: Rule factory.

Currently rules can be added to the validation class which is out of scope IMO.

Rules should be added to a factory which CAN be injected into the validation class. (We should provide a default factory and instantiate it by default if none is injected.) This way we can decouple this logic from the validation class.

emlynwest commented 9 years ago

Sounds like a good idea to me, I'd be in favour of having support for multiple factories attached to a validator to allow the multiple rule sets that sparked this issue.

sagikazarmark commented 9 years ago

I would rather make it possible to add custom rules to the default factory.