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 improvements

Hello. I think that twice validaton classes are unnecessary and confusing and unclear.

So I have a proposal for phalcon DEV team on how to resolve it and make it clean.

I think that will be better that model validators will be deleted, then add into second validator which are needs Models to work, function or add into constructor to set Model, so my mean is:

$element->addValidation(new Validator\Uniquness("\Model\User",array('field' => 'email'));

I think that will be better :) what you mean ?

"Sorry for my english"



98.9k
Accepted
answer
edited Aug '14

I think remove model validators from Phalcon will break several applications which is something we don't want right now. I think we could deprecate them later in order to promote Phalcon\Validation.



17.0k

Phalcon, maybe giving a short notice about this recommendation in official docs would be helpful for new users? Im sure they would appreciate that.