I want set error validation to input field manually in controller example:
if ($remainTime < 30) {
..... set error validation in here (error: limitTime ), ( error is not in model )
}
other question: i want to ask : bindModel ( in this case , I use bindModel in Behaviors ) 'll cause loss of relationship with other model but is bindModel cause loss of $var validate,too ?
if the $validate is defined in the model, bindModel wont cause closs of $var validate.
As for you primary question; you can set/unset/update $validationErrors of the models..eg
($remainTime < 30) {
$this->Model->validationErrors['limitTime'] = "time is less than 30";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With