/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = ParamServer::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         // uncomment the following line if you do not want to any records when validation fails
         // $query->where('0=1');
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'url', $this->url])->andFilterWhere(['like', 'type', $this->type]);
     return $dataProvider;
 }
Example #2
0
?>

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

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

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

                <?php 
$items_server = ArrayHelper::map(ParamServer::find()->all(), 'id', 'name');
?>
                <?php 
echo $form->field($model, 'serverType')->dropDownList($items_server);
?>

                <?php 
echo $form->field($model, 'chage_data')->hiddenInput()->label(false);
?>

                <?php 
echo $form->field($model, 'setOrder')->hiddenInput()->label(false);
?>
            </div>
            <div id="yw0_tab_2" class="tab-pane">
                <?php 
 /**
  * Finds the ParamServer model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return ParamServer the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = ParamServer::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }