We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Moving Validation out of model

I have a big method validation() beacause i validate many fields, how i can move this validation to another file ?



43.9k
edited May '15

Hi,

maybe you will find inspiration here

I dont mean creating new validators - i dont have problem with that. I mean that in validation() method in my model i have many $this->validate() for many fields and i want to move it to another file, is it possible to use trait for example ?