我使用himiklab/yii2-recaptcha-widget
。提交表單時,我總是收到驗證錯誤。谷歌recaptcha驗證yii2總是失敗
{"captcha":["The verification code is incorrect."]}.
形式:
$form->field($model, 'captcha',['template' => "{input}\n{hint}\n{error}"])->widget(
\himiklab\yii2\recaptcha\ReCaptcha::className(),
[
'siteKey' => <mysitekey>,
'widgetOptions' => ['id'=>'recaptcha1']
])
控制器:
if(isset($_POST['Contact'])){
if ($model->load(Yii::$app->request->post()) && $model->save()) {
我在做什麼錯?
如何嘗試在模板中給出的基本驗證碼? –