Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions en/appendices/3-5-migration-guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,6 @@ New Features
* ``Cake\Validation\Validator::addDefaultProvider()`` was added. This method
lets you inject validation providers into all the validators created in your
application.
* ``Cake\View\Helper\PaginatorHelper::limitControl()`` was added. This method
lets you create a form with a select box for updating the limit value on
a paginated result set.
41 changes: 31 additions & 10 deletions en/views/helpers/paginator.rst
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,37 @@ There are a number of options for ``counter()``. The supported ones are:
:php:meth:`PaginatorHelper::defaultModel()`. This is used in
conjunction with the custom string on 'format' option.

Generating Pagination URLs
==========================

.. php:method:: generateUrl(array $options = [], $model = null, $full = false)

By default returns a full pagination URL string for use in non-standard contexts
(i.e. JavaScript). ::

echo $this->Paginator->generateUrl(['sort' => 'title']);

Creating a Limit Selectbox Control
==================================

.. php:method:: limitControl(array $limits = [], $default = null, array $options = [])

Create a dropdown control that changes the ``limit`` query parameter::

// Use the defaults.
echo $this->Paginator->limitControl();

// Define which limit options you want.
echo $this->Paginator->limitControl([25 => 25, 50 => 50]);

// Custom limits and set the selected option
echo $this->Paginator->limitControl([25 => 25, 50 => 50], $user->perPage);

The generated form and control will automatically submit on change.

.. versionadded:: 3.5.0
The ``limitControl()`` method was added in 3.5.0

Configuring Pagination Options
==============================

Expand Down Expand Up @@ -504,16 +535,6 @@ markers::
{{count}} total, starting on record {{start}}, ending on {{end}}'
]) ?>

Generating Pagination URLs
==========================

.. php:method:: generateUrl(array $options = [], $model = null, $full = false)

By default returns a full pagination URL string for use in non-standard contexts
(i.e. JavaScript). ::

echo $this->Paginator->generateUrl(['sort' => 'title']);

.. _paginator-helper-multiple:

Paginating Multiple Results
Expand Down