Ejemplo n.º 1
0
 protected function findModel($id)
 {
     if (($model = Settings::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }
Ejemplo n.º 2
0
 public function search($params)
 {
     $query = Settings::find();
     $dataProvider = new ActiveDataProvider(['query' => $query]);
     $this->load($params);
     if (!$this->validate()) {
         return $dataProvider;
     }
     $query->andFilterWhere(['id' => $this->id]);
     $query->andFilterWhere(['like', 'type', $this->type])->andFilterWhere(['like', 'section', $this->section])->andFilterWhere(['like', 'key', $this->key])->andFilterWhere(['like', 'value', $this->value]);
     return $dataProvider;
 }