PEAR Manual
Prev |  | Next

# Pager_Sliding::Sliding()

Pager_Sliding::Sliding() -- Creates a pager instance

## Synopsis

    require_once 'Pager/Sliding.php';

``object &Sliding` (array $options)`

## Parameter

Pager_Sliding constructor takes an associative array of parameters as input values. This is the complete list of these options:

- `itemData` [array]

  Array of items to page.

- `totalItems` [integer]

  Number of items to page (used only if `itemData` is not provided).

- `perPage` [integer]

  Number of items to display on each page.

- `delta` [integer]

  Number of page numbers to display before and after the current one.

- `expanded` [boolean]

  if `TRUE`, window size is always 2*delta+1

- `linkClass` [string]

  Name of CSS class used for link styling.

- `urlVar` [string]

  Name of URL var used to indicate the page number. Default value is "pageID".

- `path` [string]

  Complete path to the page (without the page name).

- `fileName` [string]

  name of the page, with a "%d" if `append` == `TRUE`.

- `append` [boolean]

  If `TRUE` pageID is appended as GET value to the URL. If `FALSE` it is embedded in the URL according to `fileName` specs.

- `altPrev` [string]

  Alt text to display for prev page, on prev link. Default value is "previous page";

- `altNext` [string]

  Alt text to display for next page, on next link. Default value is "next page";

- `altPage` [string]

  Alt text to display before the page number. Default value is "page ".

- `prevImg` [string]

  Something to display instead of "<<". It can be text such as "<< PREV" or an <img/> as well.

- `nextImg` [string]

  Something to display instead of ">>". It can be text such as "NEXT >>" or an <img/> as well.

- `separator` [string]

  What to use to separate numbers. It can be an <img/>, a comma, an hyphen, or whatever.

- `spacesBeforeSeparator` [integer]

  Number of spaces before the separator.

- `spacesAfterSeparator` [integer]

  Number of spaces after the separator.

- `firstPagePre` [string]

  String used before first page number. It can be an <img/>, a "{", an empty string, or whatever.

- `firstPagePost` [string]

  String used after first page number. It can be an <img/>, a "}", an empty string, or whatever.

- `lastPagePre` [string]

  Similar to `firstPagePre`, but used for last page number.

- `lastPagePost` [string]

  Similar to `firstPagePost`, but used for last page number.

- `curPageLinkClassName` [string]

  Name of CSS class used for current page link.

- `lastPagePost` [boolean]

  if there's only one page, don't display pager (returns an empty string).

REQUIRED options are:

- `fileName` IF `append`==`FALSE` (default is `TRUE`)

- `itemData` OR `totalItems` (if itemData is set, totalItems is overwritten)

## Return value

`object` - a specific Pager_Sliding instance or a PEAR_Error object, if fails

Prev | Home | Next
Pager_Sliding::numPages() | Up | HTTP