Tags » Pagination

Pagination dengan SQL_CALC_FOUND_ROWS

Untuk pagination, umumnya kita menggunakan fungsi COUNT() untuk mendapatkan total record setalah itu menggunakan klausa LIMIT untuk mendapatkan data sesuai page yang diinginkan. 389 more words

Php

How to add wordpress pagination without plugin

Add the following function to your functions.php file:

function pagination($pages = '', $range = 4)
{
$showitems = ($range * 2)+1;

global $paged;
if(empty($paged)) $paged = 1;

if($pages == '')
{
global $wp_query;
$pages = $wp_query->max_num_pages;
if(!$pages)
{
$pages = 1;
}
}

if(1 != $pages)
{
echo "<div class=\"pagination\"><span>Page ".$paged." of ".$pages."</span>";
if($paged > 2 && $paged > $range+1 && $showitems < $pages) echo "<a href='".get_pagenum_link(1)."'>« First</a>";
if($paged > 1 && $showitems < $pages) echo "<a href='".get_pagenum_link($paged - 1)."'>‹ Previous</a>";

for ($i=1; $i <= $pages; $i++)
{
if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
{
echo ($paged == $i)? 260 more words
Pagination

How to paginate multiple results in CakePHP?

Here is my solution. In your controller :

function index(){
    // Your default model
    $this->set('model1', $this->paginate());
    // Pagination for model2
    $this->set('model2', $this->paginate('Model2'));
}

In your view : 79 more words

Cakephp Framework

Add pagination on custom post type

To add pagination on a custom post type archive page, I used the Simple Pagination plugin to make it work.

$paged = get_query_var('paged') ? get_query_var('paged') : 1;
17 more words

Blog

Ajax Pagination With Will_Pagination

1) index.js.erb

$(“#sc_list_div”).html(“<%= escape_javascript(render :partial => ‘list’) %>”);

Comment : sc_list_div is defined in index.html.erb and into this div Partial file is called

1) lib ==> constant.rb… 128 more words

Easy Pagination helper

One of the first things I wrote when I started working in PHP was a nice little Pagination helper class.

It is very easy to use and made my work easier many times. 229 more words

PHP

How to make pages in PHP (Pagination)

Pagination

Pagination is a technique of organizing a lot of data in a web page to make it more realizable.

Background

Let’s say you are developing a site for an online institution. 481 more words

Institution Database