/**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = CategoryTraining::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;
 }
Esempio n. 2
0
                <td>Escape Room</td>
                <td>Canyoning</td>
                <td>Parapente</td>
            </tr>
            <tr>
                <td>Picnic</td>
                <td>Camping</td>
                <td>Boat racing</td>
                <td>Parachute</td>
            </tr>
            </tbody>
        </table>
    </div>

    <?php 
echo $form->field($model, 'id_training')->radioList(ArrayHelper::map(CategoryTraining::find()->all(), 'id', 'name'), ['prompt' => 'Select Training...'])->hint('Indicate which level of training is required to have, to be able to come to do this activity');
?>

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

    <div class="col-sm-12" id="tbl_display">
        <table class="table table-bordered table-condensed table-striped">
            <thead>
            <tr>
                <th>Mountain Activities</th>
                <th>Forest Activities</th>
                <th>Beach & Sea Activities</th>
                <th>Fresh Water Activities</th>
                <th>Aero Activities</th>