skills on main page api and admin
This commit is contained in:
36
frontend/modules/api/controllers/SkillsController.php
Normal file
36
frontend/modules/api/controllers/SkillsController.php
Normal 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;
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user