0
0

SiteController.php 394 B

12345678910111213141516171819202122
  1. <?php
  2. namespace api\modules\v1\controllers;
  3. use yii\rest\ActiveController;
  4. use yii\rest\Controller;
  5. /**
  6. * Site controller
  7. */
  8. class SiteController extends ActiveController
  9. {
  10. public function actionIndex()
  11. {
  12. \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
  13. return [
  14. 'message' => 'API test Ok!',
  15. 'code' => 100,
  16. ];
  17. }
  18. }