bootstrap 3 pagination with codeigniter

前端 未结 5 993
不知归路
不知归路 2020-12-13 04:41

I cant integrate the bootstrap 3 in my pagination, I am using codeigniter in my system, here is my code so far

$config[\'base_url\'] = base_url().\"/merchant         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 05:37

    1) Controlller       
    
            $this->load->library('pagination');
            $config = [
                'base_url' => base_url('admin/deactiveUser'),
                'per_page' => 10,
                'total_rows' => $this->AdminModel->num_rows(),
            ];
    
            $config['full_tag_open'] = '
      '; $config['full_tag_close'] = '
    '; $config['num_tag_open'] = '
  • '; $config['num_tag_close'] = '
  • '; $config['cur_tag_open'] = '
  • '; $config['cur_tag_close'] = '
  • '; $config['next_tag_open'] = '
  • '; $config['next_tagl_close'] = '
  • '; $config['prev_tag_open'] = '
  • '; $config['prev_tagl_close'] = '
  • '; $config['first_tag_open'] = '
  • '; $config['first_tagl_close'] = '
  • '; $config['last_tag_open'] = '
  • '; $config['last_tagl_close'] = '
  • '; $config['attributes'] = array('class' => 'page-link'); $this->pagination->initialize($config); // model function $seeker = $this->AdminModel->seekerlist($config['per_page'], $this->uri->segment(3)); // list of seeker 2)Model public function seekerlist($limit,$offset) { $query = $this->db->select('*') ->from('user') ->limit($limit,$offset) ->get(); return $query->result_array(); } public function num_rows() { $query = $this->db->select('*') ->from('user') ->get(); return $query->num_rows(); } 3)View "/> Deactive pagination->create_links() ?>

提交回复
热议问题