예제 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Progdi::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(['kd_progdi' => $this->kd_progdi]);
     $query->andFilterWhere(['like', 'nama_progdi', $this->nama_progdi]);
     return $dataProvider;
 }
예제 #2
0
    <?php 
echo $form->field($model, 'nim')->textInput();
?>

    <?php 
echo $form->field($model, 'nama')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'no_telpon')->textInput(['maxlength' => true]);
?>

    
     <?php 
echo $form->field($model, 'progdi')->dropDownList(ArrayHelper::map(Progdi::find()->all(), 'kd_progdi', 'nama_progdi'));
?>


    <?php 
echo $form->field($model, 'judul')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->textInput();
?>

    <?php 
echo $form->field($model, 'deskripsi')->textarea(['rows' => 6]);
?>