PaginatorHelper Class Reference

Public Member Functions | |
| counter ($options=array()) | |
| current ($model=null) | |
| defaultModel () | |
| first ($first= '<< first', $options=array()) | |
| hasNext ($model=null) | |
| hasPage ($model=null, $page=1) | |
| hasPrev ($model=null) | |
| last ($last= 'last >>', $options=array()) | |
| link ($title, $url=array(), $options=array()) | |
| next ($title= 'Next >>', $options=array(), $disabledTitle=null, $disabledOptions=array()) | |
| numbers ($options=array()) | |
| options ($options=array()) | |
| params ($model=null) | |
| prev ($title= '<< Previous', $options=array(), $disabledTitle=null, $disabledOptions=array()) | |
| sort ($title, $key=null, $options=array()) | |
| sortDir ($model=null, $options=array()) | |
| sortKey ($model=null, $options=array()) | |
| url ($options=array(), $asArray=false, $model=null) | |
Public Attributes | |
| $helpers = array('Html', 'Ajax') | |
| $options = array() | |
Detailed Description
Definition at line 35 of file paginator.php.
Member Function Documentation
| PaginatorHelper::counter | ( | $ | options = array() |
) |
Returns a counter string for the paged result set
- Parameters:
-
mixed $options Options for the counter string. See options for list of keys.
- Returns:
- string Counter string.
Definition at line 391 of file paginator.php.
References $options, $out, current(), defaultModel(), ife(), Helper::model(), options(), Helper::output(), and params().
| PaginatorHelper::current | ( | $ | model = null |
) |
Gets the current page of the recordset for the given model
- Parameters:
-
string $model Optional model name. Uses the default if none is specified.
- Returns:
- string The current page number of the recordset.
Definition at line 120 of file paginator.php.
References Helper::$params, and params().
| PaginatorHelper::defaultModel | ( | ) |
| PaginatorHelper::first | ( | ) |
Returns a first or set of numbers for the first pages
- Parameters:
-
mixed $first if string use as label for the link, if numeric print page numbers mixed $options
- Returns:
- string numbers string.
Definition at line 547 of file paginator.php.
References $options, $out, Helper::$params, defaultModel(), link(), Helper::model(), and params().
Referenced by numbers().
| PaginatorHelper::hasNext | ( | $ | model = null |
) |
Returns true if the given result set is not at the last page
- Parameters:
-
string $model Optional model name. Uses the default if none is specified.
- Returns:
- boolean True if the result set is not at the last page.
Definition at line 339 of file paginator.php.
References next().
| PaginatorHelper::hasPage | ( | $ | model = null, |
|
| $ | page = 1 | |||
| ) |
Returns true if the given result set has the page number given by $page
- Parameters:
-
string $model Optional model name. Uses the default if none is specified. int $page The page number - if not set defaults to 1.
- Returns:
- boolean True if the given result set has the specified page number.
Definition at line 349 of file paginator.php.
References params().
| PaginatorHelper::hasPrev | ( | $ | model = null |
) |
Returns true if the given result set is not at the first page
- Parameters:
-
string $model Optional model name. Uses the default if none is specified.
- Returns:
- boolean True if the result set is not at the first page.
Definition at line 330 of file paginator.php.
References prev().
| PaginatorHelper::last | ( | $ | last = 'last >>', |
|
| $ | options = array() | |||
| ) |
Returns a last or set of numbers for the last pages
- Parameters:
-
mixed $last if string use as label for the link, if numeric print page numbers mixed $options
- Returns:
- string numbers string.
Definition at line 590 of file paginator.php.
References $options, $out, Helper::$params, defaultModel(), link(), Helper::model(), and params().
Referenced by numbers().
| PaginatorHelper::link | ( | $ | title, | |
| $ | url = array(), |
|||
| $ | options = array() | |||
| ) |
Generates a plain or Ajax link with pagination parameters
- Parameters:
-
string $title Title for the link. mixed $url Url for the action. See Router::url() array $options Options for the link. See options for list of keys.
- Returns:
- string A link with pagination parameters.
Definition at line 249 of file paginator.php.
References $options, $url, current(), Set::filter(), Helper::model(), options(), and url().
| PaginatorHelper::next | ( | $ | title = 'Next >>', |
|
| $ | options = array(), |
|||
| $ | disabledTitle = null, |
|||
| $ | disabledOptions = array() | |||
| ) |
Generates a "next" link for a set of paged records
- Parameters:
-
string $title Title for the link. Defaults to 'Next >>'. mixed $options Options for pagination link. See options for list of keys. string $disabledTitle Title when the link is disabled. mixed $disabledOptions Options for the disabled pagination link. See options for list of keys.
- Returns:
- string A "next" link or or $disabledTitle text if the link is disabled.
Definition at line 204 of file paginator.php.
References $options.
Referenced by hasNext().
| PaginatorHelper::numbers | ( | $ | options = array() |
) |
Returns a set of numbers for the paged result set uses a modulus to decide how many numbers to show on each side of the current page (default: 8)
- Parameters:
-
mixed $options Options for the numbers, (before, after, model, modulus, separator)
- Returns:
- string numbers string.
Definition at line 441 of file paginator.php.
References $options, $out, Helper::$params, defaultModel(), first(), last(), link(), Helper::model(), Helper::output(), and params().
| PaginatorHelper::options | ( | $ | options = array() |
) |
Sets default options for all pagination links
- Parameters:
-
mixed $options Default options for pagination links. If a string is supplied - it is used as the DOM id element to update. See options for list of keys.
Definition at line 91 of file paginator.php.
References $options, defaultModel(), and params().
Referenced by counter(), link(), sortDir(), sortKey(), and url().
| PaginatorHelper::params | ( | $ | model = null |
) |
Gets the current page of the in the recordset for the given model
- Parameters:
-
string $model Optional model name. Uses the default if none is specified.
- Returns:
- string The current page number of the paginated resultset.
Definition at line 76 of file paginator.php.
References defaultModel().
Referenced by counter(), current(), defaultModel(), first(), hasPage(), last(), numbers(), options(), sortDir(), sortKey(), and url().
| PaginatorHelper::prev | ( | ) |
Generates a "previous" link for a set of paged records
- Parameters:
-
string $title Title for the link. Defaults to '<< Previous'. mixed $options Options for pagination link. See options for list of keys. string $disabledTitle Title when the link is disabled. mixed $disabledOptions Options for the disabled pagination link. See options for list of keys.
- Returns:
- string A "previous" link or $disabledTitle text if the link is disabled.
Definition at line 192 of file paginator.php.
References $options.
Referenced by hasPrev().
| PaginatorHelper::sort | ( | $ | title, | |
| $ | key = null, |
|||
| $ | options = array() | |||
| ) |
Generates a sorting link
- Parameters:
-
string $title Title for the link. string $key The name of the key that the recordset should be sorted. array $options Options for sorting link. See options for list of keys.
- Returns:
- string A link sorting default by 'asc'. If the resultset is sorted 'asc' by the specified key the returned link will sort by 'desc'.
Definition at line 216 of file paginator.php.
References $options, $url, Inflector::humanize(), link(), Helper::model(), order, sortDir(), sortKey(), and url().
| PaginatorHelper::sortDir | ( | $ | model = null, |
|
| $ | options = array() | |||
| ) |
Gets the current direction the recordset is sorted
- Parameters:
-
string $model Optional model name. Uses the default if none is specified. mixed $options Options for pagination links. See options for list of keys.
- Returns:
- string The direction by which the recordset is being sorted, or null if the results are not currently sorted.
Definition at line 164 of file paginator.php.
References $options, Helper::$params, current(), options(), order, and params().
Referenced by sort().
| PaginatorHelper::sortKey | ( | $ | model = null, |
|
| $ | options = array() | |||
| ) |
Gets the current key by which the recordset is sorted
- Parameters:
-
string $model Optional model name. Uses the default if none is specified. mixed $options Options for pagination links. See options for list of keys.
- Returns:
- string The name of the key by which the recordset is being sorted, or null if the results are not currently sorted.
Definition at line 136 of file paginator.php.
References $options, Helper::$params, options(), order, params(), and sort().
| PaginatorHelper::url | ( | $ | options = array(), |
|
| $ | asArray = false, |
|||
| $ | model = null | |||
| ) |
Merges passed URL options with current pagination state to generate a pagination URL.
- Parameters:
-
array $options Pagination/URL options array boolean $asArray string $model Which model to paginate on
- Returns:
- mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
Definition at line 275 of file paginator.php.
References $options, $url, current(), Set::diff(), options(), order, params(), sort(), and sortKey().
Member Data Documentation
| PaginatorHelper::$helpers = array('Html', 'Ajax') |
| PaginatorHelper::$options = array() |
The documentation for this class was generated from the following file:
- 1.2.x.x/cake/libs/view/helpers/paginator.php