SiteController.php 1.21 KB
<?php

namespace app\api\controllers;

use Yii;
use yii\web\Response;
use yii\filters\ContentNegotiator;
use yii\web\Controller;
use common\models\SysSetting as SysSettingModel;
use common\helpers\Log as AppLog;
use stdClass;

/**
 * Class SiteController
 * @package app\api\controllers
 */
class SiteController extends Controller
{
    public function behaviors()
    {
        parent::behaviors();
        return [
            'contentNegotiator' => [
                'class' => ContentNegotiator::className(),
                'formats' => [
                    'application/json' => Response::FORMAT_JSON
                ],
            ]
        ];
    }

    public function actionIndex()
    {
        $content = [
        ];
        return $content;
    }

    /**
     * @return stdClass
     */
    public function actionErrorPageInfo()
    {
        $e = new stdClass();
        $e->success = true;
        $e->head = '';
        $e->content = '';
        $req = Yii::$app->request;
        $code = $req->get('code');


        return $e;
    }

    public function actionMinaQuery()
    {
        echo "mina query";
        $xml = file_get_contents('php://input', 'r');
        AppLog::DEBUG('== actionMinaQuery ==');
    }
}