Custom validation has params "skipOnError" and "skipOnEmpty" set to true. You could try to set them to false.
Additional note: The most of validation methods have names started by "validate" like in "validateSomething" but I am note sure that Yii2 forces this naming convetion.
If you dont have xdebug (as it seems) you should try to add only
$this->addError(....)
or die(‘something’) in validation method just to check it being called. A reminder: It will work only in server side (you have not implemented the client-side one).
You dont specify, server-side is default. If your rules are triggering some error in client-side, server side validation is not being called, but only after all client-side are passing (when server side is run again).
In controller I wasn’t calling the validate() method… How stupid of me!
public function actionChgpass()
{
$model = new ChgpassForm();
if ($model->load(Yii::$app->request->post())):
if ($model->validate()): <--- I was forgetting this!
// do my stuff
endif;
endif;
return $this->render('chgpass', [
'model' => $model,
]);
}