Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
5feba594
Commit
5feba594
authored
Feb 28, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added relational link tags to LinkPager widget
for prev, next, first and last page.
http://www.w3.org/TR/html401/struct/links.html#h-12.1.2
parent
8a323795
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
LinkPager.php
framework/widgets/LinkPager.php
+14
-0
No files found.
framework/CHANGELOG.md
View file @
5feba594
...
...
@@ -148,6 +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)
-
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)
...
...
framework/widgets/LinkPager.php
View file @
5feba594
...
...
@@ -107,10 +107,24 @@ class LinkPager extends Widget
*/
public
function
run
()
{
$this
->
registerLinkTags
();
echo
$this
->
renderPageButtons
();
}
/**
* Registers relational link tags in the html header for prev, next, first and last page.
* These links are generated using [[yii\data\Pagination::getLinks()]].
* @see http://www.w3.org/TR/html401/struct/links.html#h-12.1.2
*/
protected
function
registerLinkTags
()
{
$view
=
$this
->
getView
();
foreach
(
$this
->
pagination
->
getLinks
()
as
$rel
=>
$href
)
{
$view
->
registerLinkTag
([
'rel'
=>
$rel
,
'href'
=>
$href
],
$rel
);
}
}
/**
* Renders the page buttons.
* @return string the rendering result
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment