We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

Validation - Cant make custom class with own validation rules


I'm trying to make a validation class, like the one here: https://docs.phalcon.io/en/latest/reference/validation.html

But when i try to call the $validation = new MyValidation(); it says that the class can't be found..

Im trying to use my rules inside my model in the public function validate()

And also i dont know if this is the right category, sorry if not - Just couldent find any category with "Validation"

Sorry for my bad english :-)

Is your class somewhere where the autoloader can find it?

I guess i should have setup a autoloader.. Sorry i'm new to this :-)

Could you give me an code example to put in the loader.php? :-)