Esempio n. 1
0
 /**
  * Creates data provider instance with search query applied
  *
  * @param array $params
  *
  * @return ActiveDataProvider
  */
 public function search($params)
 {
     $query = Catgry::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, 'added' => $this->added]);
     $query->andFilterWhere(['like', 'name', $this->name])->andFilterWhere(['like', 'descript', $this->descript]);
     return $dataProvider;
 }
Esempio n. 2
0
        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <?php 
echo $form->field($model, 'phone')->textInput(['maxlength' => true]);
?>
        </div>
    </div>

    <div class="row">
        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <?php 
echo $form->field($model, 'website')->textInput(['type' => 'url', 'maxlength' => true]);
?>
        </div>
        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <?php 
$categories = Catgry::find()->asArray()->all();
$dataList = ArrayHelper::map($categories, 'id', 'name');
?>

            <?php 
echo $form->field($model, 'catgry')->dropDownList($dataList, ['empty' => '--- Odaberi---']);
?>
        </div>
        <div class="col-xs-4 col-sm-4 col-md-4 col-lg-4">
            <?php 
$dataList = ['0' => 'Besplatno', '1' => 'Prijatelji', '2' => 'Placeno'];
?>

            <?php 
echo $form->field($model, 'priority')->dropDownList($dataList, ['empty' => '--- Odaberi---']);
?>