Questions tagged [codeigniter-pagination]

CodeIgniter's Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.

CI pagination is more easy and understandable pagination code structure. This use basic concept of paginations and can customize as user needs.

We can add bootstrap framework pagination style to customize the pagination link.

Before start Codeigniter pagination you need to include $this->load->library('pagination'); in your controller or in autoload.php file $autoload['libraries'] = array('pagination');.

Important Notes

  1. base_url This is the full URL to the controller class/function containing your pagination. In the example above, it is pointing to a controller called “Test” and a function called “page”. Keep in mind that you can re-route your URI if you need a different structure.
  2. total_rows This number represents the total rows in the result set you are creating pagination for. Typically this number will be the total rows that your database query returned.
  3. per_page The number of items you intend to show per page. In the above example, you would be showing 20 items per page.

You can Go through Complete Codeigniter Pagination provided by codeigniter.com

17 questions
5
votes
3 answers

Codeigniter Pagination - I'm stumped

Ok, I followed the instructions in the example perfectly. Ultimately, pagination works, kind of. I get all of the pages listed: 1 | 2 | > | Last. Etc. The first one is active, like it should be. I did the querying correctly as well, because each…
willbeeler
  • 669
  • 1
  • 13
  • 25
3
votes
2 answers

SimplePie html rssfeeds Codeigniter

I wanted to ask, I have a div that I would want to place RSS feeds from the BBC or CNN. Now that works but I wanted to paginate the feeds that come in, display 5 at a time with the others showing when the links are clicked. I am starting to write…
Joseph Izang
  • 766
  • 1
  • 13
  • 43
2
votes
1 answer

Pagination with search/filter using form

I am new to codeigniter framework and I'm trying to do pagination with a search filter. I've come across answers such as this (which has no answer though) and this which also has no ticked answer so I'm not sure if it's the correct way to follow,…
kross
  • 475
  • 1
  • 11
  • 31
2
votes
1 answer

Codeigniter : won't work pagination with codeigniter

I have this function in Controller that call all item from model and make pagination in home page, So i call home page like : http://localhost/cart/index.php/ When go to next page show me this error : 404 Page Not Found My controller :- public…
Zamalek Man
  • 309
  • 2
  • 11
2
votes
1 answer

pagination message displaying a negative value

Im using codeigniter and i've implemented pagination and also the message like this one beside the pagination links Displaying 1 to 11 of 11 But somehow if the rows are lesser it displays Displaying -9 to 0 of 8 Why is it displaying a negative…
627315
  • 49
  • 5
1
vote
2 answers

Active page always showing as strong/bold, Code Igniter Pagination

The activate page is always bolded and somehow out of place. Not sure where I'm going wrong. I'm just trying to display the page links as individual links, planning to add CSS on later but can't seem to find out how to get rid of the active page…
1
vote
0 answers

CodeIgniter Pagination with Ajax filters using gender, specialization and city

Here i put doctor's name, specialization or location for searching and press continue for search. Then i comes here now you can see search records with pagination. This pagination is working fine and specializations, gender and city filters also…
1
vote
1 answer

Pagination codeigniter not directing to class active link

It so nightmare when using pagination on codeigniter. It work to move another page when click next or number after. But, the 'cur_tag_open' is not move. It still in first link of pagination. So let say, I clicked 3 on [1] [2] [3] , the class active…
Fadly Dzil
  • 2,154
  • 3
  • 34
  • 85
1
vote
1 answer

CI pagination, POST method not working

Okay, I am pretty new in CI and I am stuck on pagination. I am performing this pagination on a record set that is result of a query. Now everything seems to be working fine. But there's some problem probably with the link. I am displaying 10 results…
Gwood
  • 621
  • 1
  • 5
  • 4
1
vote
2 answers

Pagination using multiple searcing criteria in codeigniter

Im trying to implement pagination using multiple searching criteria. Supposed I Have student table. I also use pagination when the list of student displayed. The pagination link is. site_url . '/student/page/'; so I use $config['uri_segment'] =…
Adi Sembiring
  • 5,798
  • 12
  • 58
  • 70
1
vote
1 answer

is this a codeigniter vulnerability?

I discovered an error on my pagination script within CodeIgniter: $this->db->where("by_id",$user_id); $this->db->order_by("date","desc"); $this->db->limit(10,$from); $query = $this->db->get("status"); The url looks like this :…
aniss.bouraba
  • 443
  • 9
  • 18
0
votes
1 answer

Customize Codeiniter Pagination

I am using codeigniter pagination but it is return record of tables from database and show pages link, i want to use pagination for my pages view not table.
0
votes
2 answers

Sorting in CodeIgniter Pagination

The other day I managed to implement Pagination in CI using a wonderful tutorial found on the net. The next day, I noticed that Sorting was not covered in the tutorial. So I went on to implement sorting, and successfully implemented it. However, the…
Arcanyx
  • 852
  • 10
  • 25
0
votes
0 answers

codeigniter pagination via ajax

Is it possible to generate CI pagination via ajax sending page numbers through ajax instead of $config['url_segment']. $(document).on("click",".pagination li a",function(event) { event.preventDefault(); var segment =…
KBK
  • 375
  • 1
  • 4
  • 20
0
votes
0 answers

CodeIgniter Pagination only shows fixed numbers (1,2,3)

I did a pagination which pass the data through ajax from the view. in case it skip the $config['uri_segemnt'] . Here I set the total number of rows and per page manually. the function creates all the html tags and pagination tags and append them to…
KBK
  • 375
  • 1
  • 4
  • 20
1
2