Example #1
0
 public function setProvider($provider)
 {
     parent::setProvider($provider);
     $values = $this->value;
     foreach ($this->_filters as $key => $filter) {
         if (isset($values[$key]) && $values[$key] !== '') {
             call_user_func($filter, $provider, $values[$key]);
         }
     }
 }
Example #2
0
 public function setProvider($provider)
 {
     if ($this->apply) {
         parent::setProvider($query);
     } else {
         //            if (is_array($this->value) && $query instanceof ActiveQuery) {
         //                foreach ($this->value as $key => $value) {
         //                    $query->addOrderBy(new Expression($key . ' ' . $value));
         //                }
         //            } else {
         $sort = [];
         if ($this->value) {
             foreach ($this->value as $key => $value) {
                 $sort[] = ($value == 'desc' ? '-' : '') . $key;
             }
         }
         $sort = implode(',', $sort);
         if ($sort) {
             $_GET['sort'] = $sort;
         }
         // }
     }
 }
Example #3
0
 public function setProvider($provider)
 {
     if ($this->apply) {
         parent::setProvider($query);
     } else {
         //TODO перенести на  public function setAttributeOrders($attributeOrders, $validate = true) в версии ншш 2.0.10
         //            if (is_array($this->value) && $query instanceof ActiveQuery) {
         //                foreach ($this->value as $key => $value) {
         //                    $query->addOrderBy(new Expression($key . ' ' . $value));
         //                }
         //            } else {
         $sort = [];
         if ($this->value) {
             foreach ($this->value as $key => $value) {
                 $sort[] = ($value == 'desc' ? '-' : '') . $key;
             }
         }
         $sort = implode(',', $sort);
         if ($sort) {
             $_GET['sort'] = $sort;
         }
         // }
     }
 }
Example #4
0
 public function build()
 {
     $res = parent::build();
     return array_merge($res, ['collection' => $this->_exports->build()]);
 }
Example #5
0
 public function build()
 {
     parent::build();
 }
Example #6
0
 public function build()
 {
     return array_merge(parent::build(), ['buttons' => $this->buttons]);
 }
Example #7
0
 public function build()
 {
     return array_merge(parent::build(), ['text' => $this->text, 'button' => $this->button, 'collection' => $this->collection, 'pageSize' => $this->pageSize, 'pageCount' => $this->pageCount, 'page' => $this->page]);
 }
Example #8
0
 public function build()
 {
     $res = parent::build();
     return array_merge($res, ['text' => $this->text ?: Yii::t('actives', 'Search'), 'value' => $this->value, 'characters' => $this->characters, 'delay' => $this->delay]);
 }