Yii2: how to use custom validation function for activeform?

前端 未结 12 1274
独厮守ぢ
独厮守ぢ 2020-12-25 14:18

In my form\'s model, I have a custom validation function for a field defined in this way

class SignupForm extends Model
{
    public function rules()
    {
          


        
12条回答
  •  天涯浪人
    2020-12-25 14:42

    You need to trigger $model->validate() somewhere if you are extending from class Model.

提交回复
热议问题