Skip to content

Commit

Permalink
Give PaginatorHelper's next/prev links the correct 'rel' attribute
Browse files Browse the repository at this point in the history
It's a good idea to give links such as next/prev the 'rel' attribute.
See the following pages for more information:
http://www.w3.org/TR/html4/struct/links.html#edef-A
http://www.w3.org/TR/html4/types.html#type-links

Signed-off-by: mark_story <mark@mark-story.com>
  • Loading branch information
Dieter Plaetinck authored and markstory committed Dec 27, 2010
1 parent 5ce66d3 commit 6539460
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cake/libs/view/helpers/paginator.php
Expand Up @@ -252,6 +252,10 @@ public function sortDir($model = null, $options = array()) {
* @return string A "previous" link or $disabledTitle text if the link is disabled.
*/
public function prev($title = '<< Previous', $options = array(), $disabledTitle = null, $disabledOptions = array()) {
$defaults = array(
'rel' => 'prev'
);
$options = array_merge($defaults, (array)$options);
return $this->__pagingLink('Prev', $title, $options, $disabledTitle, $disabledOptions);
}

Expand All @@ -271,6 +275,10 @@ public function prev($title = '<< Previous', $options = array(), $disabledTitle
* @return string A "next" link or or $disabledTitle text if the link is disabled.
*/
public function next($title = 'Next >>', $options = array(), $disabledTitle = null, $disabledOptions = array()) {
$defaults = array(
'rel' => 'next'
);
$options = array_merge($defaults, (array)$options);
return $this->__pagingLink('Next', $title, $options, $disabledTitle, $disabledOptions);
}

Expand Down

0 comments on commit 6539460

Please sign in to comment.