I can do this in my model:
use Phalcon\Mvc\Model\Validator; $this->validate(new Validator\Email([ 'field' => 'email', 'message' => 'Sorry, your email is invalid.' ]));
But Why cant do this? $this->validate->appendMessage('test');
1: How would I do a custom validation and add it into there? For example if (true) { $this->validate->appendMessage('You cant do that!'); $this->validate->setFailure? }
2: What is the "field" value coming from? Is it the model::$value?
3: Then whats the difference with this https://docs.phalcon.io/en/latest/api/Phalcon_Validation.html versus https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_Model_Validator.html
Does the model validation just have more features only for the models?