pagination()

Display the pagination controls.

Display the pagination controls. Types supported by default are simple, paginate and advanced. The base and format parameters are used only for the paginate view.

Function Definition

public function pagination ( $params = null )

Source File: /pods/classes/Pods.php

Since: 2.0

Parameters

PARAMETERTYPEDETAILS
$params(array)Associative array of parameters

Additional Parameter Options

OPTIONTYPEDEFAULTDETAILS
type(string)advancedPagination style to use: advanced, simple, paginate, list
label(string)Go to page:Label text to appear next to pagination
show_label(boolean)trueWhether to show the label text
first_text(string)« FirstText for the First page
prev_text(string)‹ PreviousText for the Previous page
next_text(string)Next ›Text for the Next page
last_text(string)Last »Text for the Last page
prev_next(boolean)trueWhether to show the Previous and Next text
first_last(boolean)trueWhether to show the First and Last text
limit(int)$this->limitItems per page, inherited by anything run by find()
page(int)$this->pageCurrent page number
mid_size(int)2How many numbers to either side of current page, but not including current page
end_size(int)1How many numbers on either the start and the end list edges
total_found(int)$this->total_found()Total items across all pagination
page_var(string)$this->page_varPagination variable to use in URL
base(string){$url}{$append}%_%Pagination Base URL
format(string){$this->page_var}=%#%Pagination Format

Returns

(string) Pagination HTML

Examples

<?php 
$pod = pods( 'my_pod' ); 

$params = array( 'limit' => 15 ); 

$pod->find( $params ); 

// Advanced Pagination 
echo $pod->pagination( array( 'type' => 'advanced' ) ); 

// Simple Pagination 
echo $pod->pagination( array( 'type' => 'simple' ) ); 

// Paginate 
echo $pod->pagination( array( 'type' => 'paginate' ) );

Other Helpful Documentation on pods()

add_to()

Add an item to the values of a relationship field.

add()

Add an item to a Pod.

data()

Return an array of all rows returned from a find() call.

delete()

Delete an item from the Pod.

display()

Return the output for a field.

do_magic_tags()

Replace magic tags with their values.

duplicate()

Duplicate an item.

exists()

Whether a Pod item exists or not when using fetch() or construct with an ID or slug.

export_data()

Export data from all items.

export()

Export an item’s data.

fetch()

Fetch an item from a Pod.

field()

Return the value for a field.

fields()

Return field array from a Pod, a field’s data, or a field option.

filters()

Output search filters to be used with find().

find()

Find items of a pod.

first_id()

Return the first item ID.

form()

Embed a form to add / edit a pod item from within your theme.

helper()

Run a helper within a Pod Page or WP Template.

id()

Return the item ID.

import()

Import data.

index()

Return the item name.

last_id()

Return the last item ID.

next_id()

Return the next item ID.

nth()

Fetch the nth state.

position()

Fetch the current position in the loop.

prev_id()

Return the previous item ID.

raw()

Return the raw output for a field.

remove_from()

Remove values from fields.

reset_pod()

Delete all items from the Pod.

reset()

Reset the item position back to the start of the find() list.

row()

Return row array for an item.

save()

Save an item.

template()

Display the page template.

total_found()

Fetch to total number of rows found.

total()

Fetch the total row count.

valid()

Pod object validity.

zebra()

Fetch the zebra switch.