分页不在codeigniter中工作

时间:2017-09-08 09:01:18

标签: codeigniter

我的控制器页面

   public function select($limit, $start)  
  {  
     $this->db->limit($limit, $start);
     $query = $this->db->get('student');  
     return $query->result();  
  } 

} 我的模式页面

 <p><?php echo $links; ?></p>

我的观看页面

data() {
   return {
       email: '',
       password: '',
   }
},
methods: {
   login() {
       var data = {
           client_id: 2,
           client_secret: '****************************',
           grant_type: 'password',
           username: this.email,
           password: this.password
       }
       // send data
       this.$http.post('oauth/token', data)
          .then(response => {
               // authenticate the user
               this.$store.dispatch({
                   type: 'authenticate',
                   token: response.body.access_token,
                   expiration: response.body.expires_in + Date.now()
               })
               // redirect after successful login
               if (this.$route.query.from)
                    this.$router.push(this.$route.query.from)
               else
                    this.$router.push('/feed')
               })
        }
    }

这里所有我的代码在点击链接时发生了NOT FOUND错误&#39; s

1 个答案:

答案 0 :(得分:0)

尝试这100%将起作用

控制器:

var getColumn=new DatabaseHelper().SelectTableDatafromQuery<AlbumTable>("SELECT YourColumnName FROM AlbumTable");

型号:

public function index() {

    $data['error'] = "";

    $data['h'] = "";

    $this->load->library('pagination');

    $data['h'] = $this->inserts_model->select();

    $config['base_url'] = base_url() . '/index.php/imagec/index';
    $config['total_rows'] = count($data['h']);//it will give you total no of records
    $config['per_page'] = 2;
    $config["uri_segment"] = 3;
    $this->pagination->initialize($config);
    $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;
    $data['h'] = $this->inserts_model->select($config["per_page"], $page);
    $data["links"] = $this->pagination->create_links();
//    echo "<pre>";print_r($data);die;
    $this->load->view('select_view', $data);
  }