GoodsController.php 428 B

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