コード例 #1
0
 private function linkFiles()
 {
     if (ProgramFile::find()->where(['id_program' => $this->model->id])->exists()) {
         return Html::a('Документы', ['/file/main/program', 'id' => $this->model->id], ['class' => 'linkedFiles']);
     } else {
         return '';
     }
 }
コード例 #2
0
 protected function getIdFaculty($id, $parent = false)
 {
     if ($parent) {
         $model = Program::findOne($id);
         return $model->id_faculty;
     } else {
         $model = ProgramFile::find()->where(['id_file' => $id])->one();
         return $this->getIdFaculty($model->id_program, true);
     }
 }