daylerees / sanitizer

Sanitize data using a number of mutation methods.
259 stars 22 forks source link

Added ability to set global sanitizers. #2

Closed akuzemchak closed 10 years ago

akuzemchak commented 10 years ago

I've added a feature that allows a user to set global sanitizer rules to be applied to every item in the dataset. Simply set an item in the rules array that uses * as the key, for example:

$rules = [
    '*' => 'trim|strtolower',
    'last_name' => 'strrev',
];

Global rules will then be processed prior to the field-specific rules. Does this sound useful to you?

neilcrookes commented 10 years ago

This looks really useful, would be great to get this merged.

daylerees commented 10 years ago

Nice! Thanks Aaron (sorry missed the notification for this).