Work on #20 - Better API; Work on #16;

This commit is contained in:
Alex Solomaha
2016-12-08 21:52:54 +02:00
parent 9bce627e6a
commit 942cb73ca0
27 changed files with 776 additions and 606 deletions

35
modules/api/Module.php Normal file
View File

@@ -0,0 +1,35 @@
<?php
namespace app\modules\api;
use yii\filters\auth\QueryParamAuth;
/**
* api module definition class
*/
class Module extends \yii\base\Module
{
/**
* @inheritdoc
*/
public $controllerNamespace = 'app\modules\api\controllers';
/**
* @inheritdoc
*/
public function init()
{
parent::init();
\Yii::$app->user->enableSession = false;
}
public function behaviors()
{
$behaviors = parent::behaviors();
$behaviors['authenticator'] = [
'class' => QueryParamAuth::className(),
];
return $behaviors;
}
}