/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CategoryClassification::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]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'text', $this->text]);
     return $dataProvider;
 }
Beispiel #2
0
?>

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

    <?php 
echo $form->field($model, 'url_info')->textInput(['maxlength' => true])->hint('Optional. separate multiple with ;');
?>

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

    <?php 
echo $form->field($model, 'id_classification')->checkboxList(ArrayHelper::map(CategoryClassification::find()->all(), 'id', 'name'));
?>

    <?php 
echo $form->field($model, 'id_difficulty')->radioList(ArrayHelper::map(CategoryDifficulty::find()->all(), 'id', 'name'), ['prompt' => 'Select Difficulty...']);
?>

    <div class="col-sm-12" id="tbl_display">
        <table class="table table-bordered table-condensed table-striped">
            <thead>
            <tr>
                <th>Relax</th>
                <th>Fun</th>
                <th>Adventure</th>
                <th>Extreme</th>
            </tr>
 /**
  * Finds the CategoryClassification model based on its primary key value.
  * If the model is not found, a 404 HTTP exception will be thrown.
  * @param integer $id
  * @return CategoryClassification the loaded model
  * @throws NotFoundHttpException if the model cannot be found
  */
 protected function findModel($id)
 {
     if (($model = CategoryClassification::findOne($id)) !== null) {
         return $model;
     } else {
         throw new NotFoundHttpException('The requested page does not exist.');
     }
 }