2016-08-03 18:28:12 +05:30
|
|
|
<?php
|
|
|
|
namespace api\controllers;
|
|
|
|
|
2016-12-02 14:08:53 +05:30
|
|
|
use api\filters\NginxCache;
|
2016-08-03 18:28:12 +05:30
|
|
|
use Yii;
|
|
|
|
use yii\helpers\ArrayHelper;
|
|
|
|
|
|
|
|
class OptionsController extends Controller {
|
|
|
|
|
2017-09-19 22:36:16 +05:30
|
|
|
public function behaviors(): array {
|
2016-08-03 18:28:12 +05:30
|
|
|
return ArrayHelper::merge(parent::behaviors(), [
|
|
|
|
'authenticator' => [
|
2016-08-04 00:17:36 +05:30
|
|
|
'except' => ['index'],
|
2016-08-03 18:28:12 +05:30
|
|
|
],
|
2016-12-02 14:08:53 +05:30
|
|
|
'nginxCache' => [
|
|
|
|
'class' => NginxCache::class,
|
|
|
|
'rules' => [
|
|
|
|
'index' => 3600, // 1h
|
|
|
|
],
|
|
|
|
],
|
2016-08-03 18:28:12 +05:30
|
|
|
]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function verbs() {
|
|
|
|
return [
|
2016-08-04 00:17:36 +05:30
|
|
|
'index' => ['GET'],
|
2016-08-03 18:28:12 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2016-08-04 00:17:36 +05:30
|
|
|
public function actionIndex() {
|
|
|
|
return [
|
|
|
|
'reCaptchaPublicKey' => Yii::$app->reCaptcha->public,
|
|
|
|
];
|
2016-08-03 18:28:12 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|