A free and open-source book on ZF3 for beginners

8.8. Summary

Filters are designed to take some input data, process it, and produce some output data. Zend Framework 3 provides a lot of standard filters that can be used for creating filtering rules of your forms (or, if you wish, to filter an arbitrary data outside of forms).

The standard filters can be roughly divided into several groups:

If a standard filter is not suitable, it is possible to create a custom filter class. In this chapter, we have provided an example of how to write your own PhoneFilter class capable of filtering phone numbers.