expPaginator
extends expSubsystem
in package
This is the class expPaginator Exponent Pagination Subsystem
The expPaginator class is used to retrieve objects from the database and paginate them and optionally group the by category. It automagically handles the calls to other pages and has built-in sorting using the defined column headers.
Usage Example:
$page = new expPaginator(array(
'model'=>'faq',
'where'=>1,
'limit'=>25,
'order'=>'rank',
'controller'=>$this->baseclassname,
'action'=>$this->params['action'],
'columns'=>array('In FAQ'=>'include_in_faq', 'Submitted'=>'created_at', 'Submitted By'=>'submitter_name'),
));
Tags
Table of Contents
- $action : mixed
- $categorize : mixed
- $cats : mixed
- $controller : mixed
- $count_sql : mixed
- $default : mixed
- $firstpage : mixed
- $format : mixed
- $header_columns : mixed
- $last : mixed
- $lastpage : mixed
- $limit : mixed
- $linkables : mixed
- $model : mixed
- $next_page : mixed
- $next_shift : mixed
- $order : mixed
- $order_direction : mixed
- $page : mixed
- $page_offset : mixed
- $pagelink : mixed
- $pages : mixed
- $pages_to_show : mixed
- $previous_page : mixed
- $previous_shift : mixed
- $records : mixed
- $search_string : mixed
- $sort_dropdown : mixed
- $sql : mixed
- $start : mixed
- $total_pages : mixed
- $total_records : mixed
- $uncat : mixed
- $view : mixed
- $where : mixed
- __construct() : mixed
- expPaginator Constructor
- __get() : null
- Generic magic method
- __isset() : bool
- Generic magic method
- __set() : mixed
- Generic magic method We MUST create/set non-existing properties for Exponent code to work
- __unset() : mixed
- Generic magic method
- asc() : int
- exdoc Object/Array sorting comparison function -- sorts by a specified column in ascending order.
- desc() : int
- exdoc Object/Array sorting comparison function -- sorts by a specified column in descending order.
- makeHeaderCols() : mixed
- makeSortDropdown() : mixed
- cleanParams() : mixed
- runCallback() : mixed
Properties
$action
public
mixed
$action
= ''
$categorize
public
mixed
$categorize
= \false
$cats
public
mixed
$cats
= array()
$controller
public
mixed
$controller
= ''
$count_sql
public
mixed
$count_sql
= ''
$default
public
mixed
$default
= ''
$firstpage
public
mixed
$firstpage
= ''
$format
public
mixed
$format
= array()
$header_columns
public
mixed
$header_columns
= ''
$last
public
mixed
$last
= 0
$lastpage
public
mixed
$lastpage
= ''
$limit
public
mixed
$limit
= 0
$linkables
public
mixed
$linkables
= array()
$model
public
mixed
$model
= \null
$next_page
public
mixed
$next_page
= ''
$next_shift
public
mixed
$next_shift
= ''
$order
public
mixed
$order
= ''
$order_direction
public
mixed
$order_direction
= ''
$page
public
mixed
$page
= 1
$page_offset
public
mixed
$page_offset
= 0
$pagelink
public
mixed
$pagelink
= ''
$pages
public
mixed
$pages
= array()
$pages_to_show
public
mixed
$pages_to_show
= 10
$previous_page
public
mixed
$previous_page
= ''
$previous_shift
public
mixed
$previous_shift
= ''
$records
public
mixed
$records
= array()
$search_string
public
mixed
$search_string
= ''
$sort_dropdown
public
mixed
$sort_dropdown
= array()
$sql
public
mixed
$sql
= ''
$start
public
mixed
$start
= 0
$total_pages
public
mixed
$total_pages
= 0
$total_records
public
mixed
$total_records
= 0
$uncat
public
mixed
$uncat
= ''
$view
public
mixed
$view
= \null
$where
public
mixed
$where
= ''
Methods
__construct()
expPaginator Constructor
public
__construct([array<string|int, mixed> $params = array() ]) : mixed
This is the main entry point for using the expPaginator. See example above.
Parameters
- $params : array<string|int, mixed> = array()
-
Use this to set any of the class variables. Ones not passed will be set to a default.
Return values
mixed —__get()
Generic magic method
public
__get( $property) : null
Parameters
Return values
null —__isset()
Generic magic method
public
__isset( $property) : bool
Parameters
Return values
bool —__set()
Generic magic method We MUST create/set non-existing properties for Exponent code to work
public
__set( $property, $value) : mixed
Parameters
Return values
mixed —__unset()
Generic magic method
public
__unset( $property) : mixed
Parameters
Return values
mixed —asc()
exdoc Object/Array sorting comparison function -- sorts by a specified column in ascending order.
public
asc( $a, $b) : int
Parameters
Tags
Return values
int —desc()
exdoc Object/Array sorting comparison function -- sorts by a specified column in descending order.
public
desc( $a, $b) : int
Parameters
Tags
Return values
int —makeHeaderCols()
public
makeHeaderCols(mixed $params) : mixed
Parameters
- $params : mixed
Return values
mixed —makeSortDropdown()
public
makeSortDropdown(mixed $params) : mixed
Parameters
- $params : mixed
Return values
mixed —cleanParams()
private
cleanParams(mixed $params) : mixed
Parameters
- $params : mixed
Return values
mixed —runCallback()
private
runCallback() : mixed