Yioop_V9.5_Source_Code_Documentation

PaginationHelper extends Helper
in package

This is a helper class is used to handle pagination of search results

Tags
author

Chris Pollett

Table of Contents

MAX_PAGES_TO_SHOW  = 10
The maximum numbered links to pages to show besides the next and previous links
MIN_RESULTS_PER_PAGE  = 10
The maximum numbered links to pages to show besides the next and previous links
__construct()  : mixed
The constructor at this point does nothing
multiPagePagination()  : mixed
Draws a strip of links which begins with a previous link (if their are previous pages of links) followed by up to ten links to more search result page (if available) followed by a next set of pages link.
render()  : mixed
Draws the mechanism for paging through search/or group thread results in both the continuous scroll setting and in the setting where one clicks on next/previous, or the xth page of search results.
singleButtonPagination()  : mixed
Used to handle loading of next/previous page of search/thread results in in the continuous scroll case of displaying search results

Constants

MAX_PAGES_TO_SHOW

The maximum numbered links to pages to show besides the next and previous links

public int MAX_PAGES_TO_SHOW = 10

MIN_RESULTS_PER_PAGE

The maximum numbered links to pages to show besides the next and previous links

public int MIN_RESULTS_PER_PAGE = 10

Methods

__construct()

The constructor at this point does nothing

public __construct() : mixed
Return values
mixed

multiPagePagination()

Draws a strip of links which begins with a previous link (if their are previous pages of links) followed by up to ten links to more search result page (if available) followed by a next set of pages link.

public multiPagePagination(string $base_url, int $limit, int $results_per_page, int $total_results[, bool $micro = false ][, bool $no_follow = true ]) : mixed
Parameters
$base_url : string

the url together with base query that the search was done on

$limit : int

the number of the first link to display in the set of search results.

$results_per_page : int

how many links are displayed on a given page of search results. The minimum value of this is self::MIN_RESULTS_PER_PAGE

$total_results : int

the total number of search results for the current search term

$micro : bool = false

whether to make a tiny pagination rather than normal size (this might be suitable for discussion boards)

$no_follow : bool = true

whether to add a rel='nofollow' attribute to pagination links

Return values
mixed

render()

Draws the mechanism for paging through search/or group thread results in both the continuous scroll setting and in the setting where one clicks on next/previous, or the xth page of search results.

public render(string $base_url, int $limit, int $results_per_page, int $total_results[, bool $micro = false ][, bool $no_follow = true ]) : mixed
Parameters
$base_url : string

the url together with base query that the search was done on

$limit : int

the number of the first link to display in the set of search results.

$results_per_page : int

how many links are displayed on a given page of search results. The minimum value of this is self::MIN_RESULTS_PER_PAGE

$total_results : int

the total number of search results for the current search term

$micro : bool = false

whether to make a tiny pagination rather than normal size (this might be suitable for discussion boards)

$no_follow : bool = true

whether to add a rel='nofollow' attribute to pagination links

Return values
mixed

singleButtonPagination()

Used to handle loading of next/previous page of search/thread results in in the continuous scroll case of displaying search results

public singleButtonPagination(string $base_url, int $limit, int $results_per_page, int $total_results, bool $micro, bool $no_follow[, bool $is_previous = false ]) : mixed
Parameters
$base_url : string

the url together with base query that the search was done on

$limit : int

the number of the first link to display in the set of search results.

$results_per_page : int

how many links are displayed on a given page of search results. The minimum value of this is self::MIN_RESULTS_PER_PAGE

$total_results : int

the total number of search results for the current search term

$micro : bool

whether to make a tiny pagination rather than normal size (this might be suitable for discussion boards)

$no_follow : bool

whether to add a rel='nofollow' attribute to pagination links

$is_previous : bool = false

whether to support a link (or scroll) to page of results previous

Return values
mixed

        

Search results