I'm using Zend Framework 2.1
I want to create a blocklist of domains or email addresses for the email field of a Zend Form. I think it is possible to do with Zend InputFilter. But i don't know how to do it
InputFilter are intended to validate and sanitize a group of input data, they use Validators and Filters to achieve this goal.
What you need to block some domains is a custom validator.
The tricky part here is that you need to extract the domain from the email address, thing that the EmailAddress validator is already doing (and it does it well).
Fortunately, EmailAddress validator use an internal Hostname validator to check that the domain is valid.
Here is what I suggest :
Hope this helps.