![]() |
|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 |
|
Senior Member
Join Date: Aug 2011
Posts: 111
|
If you are searching for good looking pagination feature to implement into your Codeigniter Application, then the Flicker Type Pagination function will be a right choice. It is very dynamic and easily customizable.
1.Download the pagination class file and put it under libraries. http://www.septanet.com/attachment.p...1&d=1312537990 2.Copy and Paste below code into your controller which uses pagination functionality. PHP Code:
// $per_page_rows indicates numbers of records in a page // $total_rows indicates total number of records returned by your query // Search is a function where you are putting above code. When user clicks on hyperlinks (created by Pagination function), it takes users to the specified function in controller. // $keyword – this is not required. You can just assign empty data for this variable. // $current_page indicates the page which users currently opening. You can get it by using $this->uri->segment(n) function. Replace 'n' as per your routing setting. // $recStart – this variable is used for LIMIT clause in SQL statement which indicates the starting record for any page. 0 indicates the starting record for first page. // $this->users_model->count_users(); this function returns total number of users retrieved from database. // $this->users_model->get_users($recStart, $per_page_rows))); This function returns the number of records specified in $per_page_rows variable starting from $recStart position. 3.Copy and Paste below code into Views [e.g. users] where you would like to show pagination. Code:
<div class="margtopb" align="center">
<?php $this->paging->show(); ?>
</div>
Code:
/*Pagination Flickr style*/
div.flickr {
padding: 3px;
margin: 3px;
text-align:center;
}
div.flickr a {
border: 1px solid #cccccc;
margin-right:3px;
padding:2px 6px;
background-position:bottom;
text-decoration: none;
}
div.flickr a:hover, div.meneame a:active {
border: 1px solid #000;
background-image:none;
background-color:#215DA2;
color: #ffffff;
}
div.flickr span.current {
margin-right:3px;
padding:2px 6px;
font-weight: bold;
color: #ff0000;
background-color:#ecf1f5;
border: 1px solid #ff0000;
}
div.flickr span.disabled {
margin-right:3px;
padding:2px 6px;
color: #adaaad;
}
div.margtopb{
text-align: left;
}
/* End of Pagination style */
PHP Code:
Your valuable feedback are always welcome. |
|
|
|
|
|
#2 |
|
Senior Member
Join Date: Aug 2011
Posts: 131
|
Very useful tutorial.
Thanks |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Aug 2011
Posts: 111
|
Thank you, Sir. My pleasure to share information through forum.
|
|
|
|
|
|
#4 |
|
Senior Member
Join Date: Aug 2011
Posts: 110
|
Nice code help full!
|
|
|
|
|
|
#5 |
|
Senior Member
Join Date: Aug 2011
Posts: 111
|
Thnx Mr. Sharma.
|
|
|
|
![]() |
| Tags |
| codeigniter pagination, flicker type pagination, pagination |
| Thread Tools | |
| Display Modes | |
|
|