Advance CodeIgniter pagination

0 Cevap php

Ben CodeIgniter varsayılan sayfalama kullanarak resim galerisi oluşturduk. Görüntüleri db ve her sayfada gelen edilir 16. görüntüleri var.

Recently my customer ask me to put 32 images per each page other than the first page. This means that on the first page it only have 16 images and the other pages come after that have 32 images per page. So I change the code little bit and get the result as he asked.

Ama sorun pagination barda geldi. Ben hala 2 sayfa ben 1 sayfa duyuyorum Sayfalandırması gösteri iken.

if ($this->uri->segment(3, 0) == 0){
    $config['per_page'] = 16;
    }else{
    $config['per_page'] = 32;
    }
    $config['num_links'] = 1;
    $this->pagination->initialize($config);


    $query = $this->db->get('img', $config['per_page'], $this->uri->segment(3));//when i am in page 2 "segment(3)" will equal to 16

Bu yapabileceği başka bir alternatif Sayfalandırması kütüphane onların mıdır? Sayfa http://vintagepostersofceylon.com/posters/cinema/ yer almaktadır

0 Cevap