public function actionView($id) { $model = Video::findOne($id); $course = $model->course; $author = $course->author; return $this->render('view', ['model' => $model, 'course' => $course, 'author' => $author, 'chapters' => Course::getVideoList($course->id)]); }
/** * 课程详细页面 * @param integer $id * @return mixed */ public function actionView($id) { $model = Course::findOne($id); // $dataProvider = new ActiveDataProvider([ // 'query' => $model->getVideos(), // ]); //var_dump(Course::getVideoList($model->id)); return $this->render('view', ['model' => $model, 'author' => $model->getAuthor(), 'chapters' => Course::getVideoList($model->id)]); }