skills on main page api and admin

This commit is contained in:
andrey
2021-06-09 18:06:13 +03:00
parent 23773eff4e
commit b9f919204c
27 changed files with 842 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
namespace frontend\modules\api\controllers;
use yii\web\Controller;
/**
* Default controller for the `api` module
*/
class DefaultController extends Controller
{
/**
* Renders the index view for the module
* @return string
*/
public function actionIndex()
{
return $this->render('index');
}
}

View File

@ -0,0 +1,36 @@
<?php
namespace frontend\modules\api\controllers;
use common\models\Options;
use yii\filters\AccessControl;
class SkillsController extends \yii\rest\Controller
{
public function behaviors()
{
return [
[
'class' => \yii\filters\ContentNegotiator::className(),
'formats' => [
'application/json' => \yii\web\Response::FORMAT_JSON,
],
],
];
}
public function actionIndex()
{
return ['some' => 'rrr'];
}
public function actionSkillsOnMainPage()
{
$data = \common\models\Options::getValue('skills_on_main_page_to_front');
if ($data) $data = json_decode($data, true);
else return [];
return $data;
}
}