Commit 4d5ba13c by Carsten Brandt

make registering of link tags optional in LinkPager

parent 5feba594
......@@ -148,7 +148,7 @@ Yii Framework 2 Change Log
- Enh: Added support for building SQLs with sub-queries (qiangxue)
- Enh: Added `Pagination::getLinks()` (qiangxue)
- Enh: Added support for reading page size from query parameters by `Pagination` (qiangxue)
- Enh: LinkPager will now register relational link tags in the html header for prev, next, first and last page (cebe)
- Enh: LinkPager can now register relational link tags in the html header for prev, next, first and last page (cebe)
- Chg #1186: Changed `Sort` to use comma to separate multiple sort fields and use negative sign to indicate descending sort (qiangxue)
- Chg #1519: `yii\web\User::loginRequired()` now returns the `Response` object instead of exiting the application (qiangxue)
- Chg #1586: `QueryBuilder::buildLikeCondition()` will now escape special characters and use percentage characters by default (qiangxue)
......
......@@ -89,6 +89,13 @@ class LinkPager extends Widget
* If this property is null, the "last" page button will not be displayed.
*/
public $lastPageLabel;
/**
* @var bool whether to register link tags in the HTML header for prev, next, first and last page.
* Defaults to `false` to avoid conflicts when multiple pagers are used on one page.
* @see http://www.w3.org/TR/html401/struct/links.html#h-12.1.2
* @see registerLinkTags()
*/
public $registerLinkTags = false;
/**
......@@ -107,7 +114,9 @@ class LinkPager extends Widget
*/
public function run()
{
$this->registerLinkTags();
if ($this->registerLinkTags) {
$this->registerLinkTags();
}
echo $this->renderPageButtons();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment