getModule('student')->graduateWorkLoader; $graduateWorkLoader->setParams(Yii::$app->user->identity->guid); $this->recordBooks = $graduateWorkLoader->loadRecordBooks(); if ($this->recordBook_id == null && sizeof($this->recordBooks) > 0) { $this->recordBook_id = $this->recordBooks[0]->id; } $this->themes = $graduateWorkLoader->loadCourseGraduateWorks($this->recordBook_id); } public function run() { return $this->render('graduateWork_widget', [ 'recordBooks' => $this->recordBooks, 'themes' => $this->themes, 'recordBook_id' => $this->recordBook_id, ]); } }