change() public method

Resets password.
public change ( $runValidation = true ) : boolean
return boolean if password was reset.
 /**
  * 修改密码
  *
  * @return array
  */
 public function actionPassword()
 {
     $model = new ChangePasswordForm();
     if ($model->load(Yii::$app->request->post(), '') && $model->change()) {
         return ['status' => 'success', 'data' => []];
     } else {
         return ['status' => 'fail', 'data' => ['errors' => $model->getFirstErrors()]];
     }
 }