コード例 #1
0
 public function actionToc($id = null)
 {
     if (Yii::$app->request->getIsAjax()) {
         $res = Article::getOrderedArticleToc($id);
         Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
         return $res;
     }
     return $this->render('toc');
 }