Skip to content

Commit

Permalink
Fix issue with empty attribute name
Browse files Browse the repository at this point in the history
  • Loading branch information
nadar authored Aug 9, 2023
1 parent 2f92f01 commit e3bfd26
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/CaptchaBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,17 @@ public function frontend()
false
);

Yii::$app->forms->model->invisibleAttribute($this->getVarValue($this->varAttribute));
$varName = $this->getVarValue($this->varAttribute);
if (!$varName) {
return;
}

Yii::$app->forms->model->invisibleAttribute($varName);

// Use all possible options with ActiveField or use the HtmlHelper
return Yii::$app->forms->form->field(Yii::$app->forms->model, $this->getVarValue($this->varAttribute))
return Yii::$app->forms->form->field(Yii::$app->forms->model, $varName)
->widget('himiklab\yii2\recaptcha\ReCaptcha3')
->label(false);

}
}
}

0 comments on commit e3bfd26

Please sign in to comment.