I have the following rules:
public function rules() {
return [
[['email', 'password', 'ho_ten'], 'required'],
[['ngay_sinh', 'ngay_cap'], 'safe'],
[['id_chucvu', 'id_phongban', 'active', 'type', 'status'], 'integer'],
[['email', 'password', 'ho_ten', 'img_path', 'noi_cap', 'dia_chi', 'ten_tai_khoan', 'ngan_hang', 'chi_nhanh', 'session_id', 'id_phuong'], 'string', 'max' => 255],
[['gioi_tinh', 'id_thanhpho', 'id_quan'], 'string', 'max' => 10],
[['cmnd', 'hon_nhan'], 'string', 'max' => 20],
[['dien_thoai', 'sdt_lien_he'], 'max' => 11],
[['nguoi_lien_he', 'so_tai_khoan'], 'string', 'max' => 50],
[['auth_key'], 'string', 'max' => 32],
[['id_chucvu'], 'exist', 'skipOnError' => true, 'targetClass' => Chucvu::className(), 'targetAttribute' => ['id_chucvu' => 'id']],
[['id_phongban'], 'exist', 'skipOnError' => true, 'targetClass' => Phongban::className(), 'targetAttribute' => ['id_phongban' => 'id']],
];
}
And error in view file at this line
<?= $form->field($model, "ho_ten"); ?>
Exception (Invalid Configuration) ‘yii\base\InvalidConfigException’ with message ‘Invalid validation rule: a rule must specify both attribute names and validator type.’