Пример #1
0
 public function detail($id)
 {
     $developer = Developer::findOrFail($id);
     $biodata = Biodata::findOrFail($developer->id);
     $education = Education::findOrFail($developer->id);
     return view('developers.detail', compact('developer', 'biodata', 'education'));
 }
Пример #2
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Biodata::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to return any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id, 'TglLahir' => $this->TglLahir, 'Kearganegaraan' => $this->Kearganegaraan, 'ExpKtp' => $this->ExpKtp]);
     $query->andFilterWhere(['like', 'NoKTP', $this->NoKTP])->andFilterWhere(['like', 'Nama', $this->Nama])->andFilterWhere(['like', 'TmptLahir', $this->TmptLahir])->andFilterWhere(['like', 'Alamat', $this->Alamat])->andFilterWhere(['like', 'AlamatTinggal', $this->AlamatTinggal])->andFilterWhere(['like', 'Agama', $this->Agama])->andFilterWhere(['like', 'Status', $this->Status])->andFilterWhere(['like', 'Pekerjaan', $this->Pekerjaan])->andFilterWhere(['like', 'GolDar', $this->GolDar]);
     return $dataProvider;
 }
Пример #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getIdBio()
 {
     return $this->hasOne(Biodata::className(), ['id' => 'IdBio']);
 }
Пример #4
0
 /**
  * Finds the Biodata model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Biodata the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Biodata::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }