how to create custom filter in zend framework 2

Share/Bookmark

Okay, i have just passed 4 bloody hours googling about this issue :|. since i am a forgetful person i will write about how to create custom filter in zend framework 2 as my note if someday i need it again.

1. create new a file in your_module/Filter/Test.php

2.Edit your module.php

3. now you use it in your model in inputfilter like this :

make sure you write name including the namespace “RealEstate\Filter|Test”. i spent my last 3 bloody hours to fix this. please not change my code as you need not just copy paste. i paste the code from my project. :D

Tags : custom filter zend framework 2 tutorial zend framework 2

Leave a Reply