PaginatorHelper Class Reference

Inheritance diagram for PaginatorHelper:

AppHelper Helper Helper Overloadable Overloadable Object Object Object Object List of all members.

Public Member Functions

 __hasPage ($model, $page)
 __pagingLink ($which, $title=null, $options=array(), $disabledTitle=null, $disabledOptions=array())
 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

 $__defaultModel = null
 $helpers = array('Html', 'Ajax')
 $options = array()

Detailed Description

Definition at line 33 of file paginator.php.


Member Function Documentation

PaginatorHelper::__hasPage ( model,
page 
)

Protected method

Definition at line 363 of file paginator.php.

References Helper::$params, and params().

Referenced by hasNext(), and hasPrev().

PaginatorHelper::__pagingLink ( which,
title = null,
options = array(),
disabledTitle = null,
disabledOptions = array() 
)

Protected method for generating prev/next links

Definition at line 299 of file paginator.php.

References $options, $url, link(), Helper::model(), params(), and url().

Referenced by next(), and prev().

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 393 of file paginator.php.

References $out, current(), defaultModel(), options(), Helper::output(), params(), and start().

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 119 of file paginator.php.

References Helper::$params, and params().

Referenced by counter(), link(), numbers(), sortDir(), and url().

PaginatorHelper::defaultModel (  ) 

Gets the default model of the paged sets

Returns:
string Model name or null if the pagination isn't initialized.

Definition at line 377 of file paginator.php.

References params().

Referenced by counter(), first(), last(), numbers(), options(), params(), sort(), and sortKey().

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 560 of file paginator.php.

References $out, Helper::$params, defaultModel(), link(), 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 341 of file paginator.php.

References __hasPage(), and 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 351 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 332 of file paginator.php.

References __hasPage(), and 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 604 of file paginator.php.

References $out, Helper::$params, defaultModel(), link(), 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 250 of file paginator.php.

References $options, $url, current(), Set::filter(), Helper::model(), options(), and url().

Referenced by __pagingLink(), first(), last(), numbers(), and sort().

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 206 of file paginator.php.

References $options, and __pagingLink().

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 450 of file paginator.php.

References $out, Helper::$params, current(), defaultModel(), first(), last(), link(), 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 90 of file paginator.php.

References $options, defaultModel(), and params().

Referenced by counter(), link(), sortDir(), sortKey(), and url().

PaginatorHelper::params ( model = null  ) 

Gets the current paging parameters from the resultset for the given model

Parameters:
string $model Optional model name. Uses the default if none is specified.
Returns:
array The array of paging parameters for the paginated resultset.

Definition at line 75 of file paginator.php.

References defaultModel().

Referenced by __hasPage(), __pagingLink(), 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 194 of file paginator.php.

References $options, and __pagingLink().

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 218 of file paginator.php.

References $options, $url, __(), defaultModel(), humanize(), link(), Helper::model(), order, sortDir(), sortKey(), and url().

Referenced by 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 166 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 135 of file paginator.php.

References $options, Helper::$params, defaultModel(), options(), order, params(), and sort().

Referenced by sort(), and url().

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 277 of file paginator.php.

References $options, $url, current(), Set::diff(), options(), order, params(), sort(), and sortKey().

Referenced by __pagingLink(), link(), and sort().


Member Data Documentation

PaginatorHelper::$__defaultModel = null

Definition at line 45 of file paginator.php.

PaginatorHelper::$helpers = array('Html', 'Ajax')

Reimplemented from Helper.

Definition at line 39 of file paginator.php.

PaginatorHelper::$options = array()

Definition at line 68 of file paginator.php.

Referenced by __pagingLink(), link(), next(), options(), prev(), sort(), sortDir(), sortKey(), and url().


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:56 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7