コード例 #1
0
ファイル: TopicController.php プロジェクト: mekas/absenv2
 /**
  * pass registered course such that user can select it from the select box
  * @return view to showtopic
  */
 public function showTopic()
 {
     //from course get all registered course for this semester
     $user = Auth::user();
     //get the mapping for lecturer
     $kode_dosen = $user->lecturer->Kode_Dosen;
     //get Kode_Matkul & Nama_Matkul from course, therefore not Courses Model instance
     $courses = Course::courseMapByLecturerId($kode_dosen);
     //filter by code dosen
     $courses_arr = Helpers::toAssociativeArrays($courses);
     $Topic = Topic::topicsByKodeDosen($kode_dosen);
     return view('lecturers.showtopic')->with('Topic', $Topic)->with('Courses', $courses_arr);
 }