Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update docs for PaginatorHelper::prev() and PaginatorHelper::next(). #426

Merged
merged 1 commit into from

2 participants

en/core-libraries/helpers/paginator.rst
@@ -173,7 +173,18 @@ pages in the paged data set.
<?php
echo $this->Paginator->prev(__('previous'), array('tag' => 'li'));
// Would create
- <li class="prev"><a href="/posts/index/page:1/sort:title/order:desc" rel="prev">previous</a></li>
+ <li class="prev"><a rel="prev" href="/posts/index/page:1/sort:title/order:desc">previous</a></li>
+
+ You can also disable the wrapping tag::
+
+ <?php
+ echo $this->Paginator->prev(__('previous'), array('tag' => false));
+ // Would create
+ <a class="prev" rel="prev" href="/posts/index/page:1/sort:title/order:desc">previous</a>
+
+.. versionadded:: 2.3
@markstory Owner

This should probably be versionchanged instead of versionadded.

@sarce
sarce added a note

Updated! Thanks Mark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@markstory markstory merged commit 6a06fb7 into cakephp:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
2  en/appendices/2-3-migration-guide.rst
@@ -198,6 +198,8 @@ PaginatorHelper
- :php:meth:`PaginatorHelper::numbers()` now has a new option ``currentTag`` to
allow specifying extra tag for wrapping current page number.
+- For methods: :php:meth:`PaginatorHelper::prev()` and :php:meth:`PaginatorHelper::next()` it
+ is now possible to set the ``tag`` option to ``false`` to disable the wrapper.
Testing
=======
View
17 en/core-libraries/helpers/paginator.rst
@@ -150,7 +150,7 @@ pages in the paged data set.
``$options`` and ``$disabledOptions`` supports the following keys:
- * ``tag`` The tag wrapping tag you want to use, defaults to 'span'.
+ * ``tag`` The tag wrapping tag you want to use, defaults to 'span'. Set this to ``false`` to disable this option.
* ``escape`` Whether you want the contents html entity encoded,
defaults to true.
* ``model`` The model to use, defaults to :php:meth:`PaginatorHelper::defaultModel()`.
@@ -162,7 +162,7 @@ pages in the paged data set.
If you were currently on the second page of posts, you would get the following::
- <span class="prev"><a href="/posts/index/page:1/sort:title/order:desc" rel="prev"><< previous</a></span>
+ <span class="prev"><a rel="prev" href="/posts/index/page:1/sort:title/order:desc"><< previous</a></span>
If there were no previous pages you would get::
@@ -173,7 +173,18 @@ pages in the paged data set.
<?php
echo $this->Paginator->prev(__('previous'), array('tag' => 'li'));
// Would create
- <li class="prev"><a href="/posts/index/page:1/sort:title/order:desc" rel="prev">previous</a></li>
+ <li class="prev"><a rel="prev" href="/posts/index/page:1/sort:title/order:desc">previous</a></li>
+
+ You can also disable the wrapping tag::
+
+ <?php
+ echo $this->Paginator->prev(__('previous'), array('tag' => false));
+ // Would create
+ <a class="prev" rel="prev" href="/posts/index/page:1/sort:title/order:desc">previous</a>
+
+.. versionchanged:: 2.3
+ For methods: :php:meth:`PaginatorHelper::prev()` and :php:meth:`PaginatorHelper::next()` it
+ is now possible to set the ``tag`` option to ``false`` to disable the wrapper.
If you leave the ``$disabledOptions`` empty the ``$options`` parameter will be
used. This can save some additional typing if both sets of options are the
Something went wrong with that request. Please try again.