예제 #1
0
 public function action_index()
 {
     if (!$this->model_name) {
         return;
     }
     $filters = $this->request->query('filters');
     if (count($filters)) {
         foreach ($filters as $key => $value) {
             if ($value) {
                 $this->model->where($key, 'LIKE', '%' . $value . '%');
             }
         }
     }
     $query = $this->request->query('q');
     if ($query) {
         $this->search($query);
     }
     if ($this->request->query('_export')) {
         return $this->export();
     }
     $this->pagination();
     View::set_global('rows', $this->model->find_all());
     if (!$this->view_exists()) {
         $this->content = View::factory('template/manager/index');
     }
 }