Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions en/views/helpers/paginator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ Generates a sorting link. Sets querystring parameters for the sort and
direction. Links will default to sorting by asc. After the first click, links
generated with ``sort()`` will handle direction switching automatically. If the
resultset is sorted 'asc' by the specified key the returned link will sort by
'desc'.
'desc'. Uses the ``sort``, ``sortAsc``, ``sortDesc``, ``sortAscLocked`` and
``sortDescLocked`` templates.

Accepted keys for ``$options``:

Expand Down Expand Up @@ -191,7 +192,8 @@ 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 By default
8 links on either side of the current page will be created if those pages exist.
Links will not be generated for pages that do not exist. The current page is
also not a link.
also not a link. The ``number``, ``current`` and ``ellipsis`` templates will be
used.

Supported options are:

Expand Down Expand Up @@ -237,7 +239,8 @@ pages in the paged data set.
:param string $title: Title for the link.
:param mixed $options: Options for pagination link.

Generates a link to the previous page in a set of paged records.
Generates a link to the previous page in a set of paged records. Uses
the ``prevActive`` and ``prevDisabled`` templates.

``$options`` supports the following keys:

Expand Down Expand Up @@ -273,7 +276,8 @@ pages in the paged data set.

This method is identical to :php:meth:`~PaginatorHelper::prev()` with a few exceptions. It
creates links pointing to the next page instead of the previous one. It also
uses ``next`` as the rel attribute value instead of ``prev``
uses ``next`` as the rel attribute value instead of ``prev``. Uses the
``nextActive`` and ``nextDisabled`` templates.

.. php:method:: first($first = '<< first', $options = [])

Expand All @@ -289,7 +293,8 @@ pages in the paged data set.
echo $this->Paginator->first(3);

The above will create links for the first 3 pages, once you get to the third or
greater page. Prior to that nothing will be output.
greater page. Prior to that nothing will be output. Uses the ``first``
template.

The options parameter accepts the following:

Expand All @@ -303,7 +308,7 @@ pages in the paged data set.
method. It has a few differences though. It will not generate any links if you
are on the last page for a string values of ``$last``. For an integer value of
``$last`` no links will be generated once the user is inside the range of last
pages.
pages. Uses the ``last`` template.

Creating Header Link Tags
=========================
Expand All @@ -328,6 +333,8 @@ Checking the Pagination State
echo $this->Paginator->current('Comment');
// Output is 3

Uses the ``current`` template.

.. php:method:: hasNext(string $model = null)

Returns ``true`` if the given result set is not at the last page.
Expand All @@ -351,8 +358,8 @@ Creating a Page Counter

Returns a counter string for the paged result set. Using a provided format
string and a number of options you can create localized and application
specific indicators of where a user is in the paged data set.

specific indicators of where a user is in the paged data set. Uses the
``counterRange``, and ``counterPages`` templates.

Supported formats are 'range', 'pages' and custom. Defaults to pages which would
output like '1 of 10'. In the custom mode the supplied string is parsed and
Expand Down