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

Validation - Cant make custom class with own validation rules

Hey,

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? :-)

Thanks!