response->format = \yii\web\Response::FORMAT_JSON; return [ 'message' => 'API test Ok!', 'code' => 100, ]; // return $this->render('index'); } }