Добавлен API вызов для получения активного Recaptcha public key

This commit is contained in:
ErickSkrauch
2016-08-03 15:58:12 +03:00
parent c2986445f1
commit 5e40ccbe49
7 changed files with 85 additions and 2 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace api\controllers;
use Yii;
use yii\helpers\ArrayHelper;
use yii\web\Response;
class OptionsController extends Controller {
public function behaviors() {
return ArrayHelper::merge(parent::behaviors(), [
'authenticator' => [
'except' => ['recaptcha-public-key'],
],
]);
}
public function verbs() {
return [
'recaptcha-public-key' => ['GET'],
];
}
public function actionRecaptchaPublicKey() {
Yii::$app->response->format = Response::FORMAT_RAW;
return Yii::$app->reCaptcha->public;
}
}