예제 #1
0
 public function all($entity)
 {
     parent::all($entity);
     $this->filter = \DataFilter::source(new \App\Slider());
     $this->filter->add('active', 'Active', 'select')->options(\App\Slider::lists("Active", "active")->all());
     $this->filter->add('weight', 'Weight', 'text');
     $this->filter->add('img_url', 'Image', 'text');
     $this->filter->submit('search');
     $this->filter->reset('reset');
     $this->filter->build();
     $this->grid = \DataGrid::source($this->filter);
     $this->grid->add('active', 'Active', 'active');
     $this->grid->add('weight', 'Weight', 'weight');
     $this->grid->add('img_url', 'Image');
     $this->addStylesToGrid();
     return $this->returnView();
 }