示例#1
0
文件: FormFilter.php 项目: larakit/lk
 function toArray()
 {
     $this->init();
     $box = $this->form->putAlteBox('Фильтры списка');
     $body = $box->putAlteBoxBody()->removeClass('box-primary');
     foreach ($this->filters as $filter) {
         /* @var $filter FilterSelfLike */
         $filter->element($body);
         $filter->query($this->model);
     }
     if ($this->form->isSubmitted()) {
         $box->addClass('box-solid box-success');
     } else {
         $box->addClass('box-default');
     }
     $footer = $box->putAlteBoxFooter();
     $footer->putSubmitTwbs('Применить')->addClass('btn-success btn-disabled col-lg-6');
     $footer->putButtonLinkTwbs($this->base_url, 'Сбросить')->addClass('btn-default col-lg-6');
     //        ->removeClass('box-primary');
     return ['form_filter' => $this->form, 'models' => $this->model->paginate($this->per_page)];
 }