コード例 #1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Baselinejenis::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, 'kode_jenis' => $this->kode_jenis]);
     $query->andFilterWhere(['like', 'nama_jenis', $this->nama_jenis]);
     return $dataProvider;
 }
コード例 #2
0
 /**
  * Finds the Baselinejenis model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return Baselinejenis the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = Baselinejenis::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
コード例 #3
0
ファイル: _form.php プロジェクト: kireniusdena/Target-Output
<div class="baseline-form">

    <?php 
$form = ActiveForm::begin();
?>

    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">UPT</h3>
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-6">
                    <?php 
echo $form->field($model, 'jenis')->DropDownList(ArrayHelper::map(Baselinejenis::find()->all(), 'id', 'nama_jenis'));
?>
                </div>
                <div class="col-md-6">
                    <?php 
echo $form->field($model, 'wilayah')->textInput();
?>
                </div>
            </div>
        </div>
    </div>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">Deskripsi</h3>
        </div>
        <div class="panel-body">
コード例 #4
0
 public function getUpt()
 {
     return $this->hasOne(Baselinejenis::className(), ['kode_jenis' => 'kdgiat']);
 }