From fa03085f78f59161d005134ade81c86717af55e9 Mon Sep 17 00:00:00 2001 From: Mark Story Date: Tue, 21 Mar 2023 22:22:53 -0400 Subject: [PATCH] Add which templates are used by Paginator in each method. I had to look all of this up, and it would have saved me time if this information was in the book. --- en/views/helpers/paginator.rst | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/en/views/helpers/paginator.rst b/en/views/helpers/paginator.rst index da29aeb43a..c619e96274 100644 --- a/en/views/helpers/paginator.rst +++ b/en/views/helpers/paginator.rst @@ -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``: @@ -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: @@ -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: @@ -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 = []) @@ -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: @@ -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 ========================= @@ -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. @@ -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