From 65394604a751ccfdc8124f1f29b85a33a3d1b217 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 19 Feb 2010 10:27:16 +0100 Subject: [PATCH] Give PaginatorHelper's next/prev links the correct 'rel' attribute 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 --- cake/libs/view/helpers/paginator.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cake/libs/view/helpers/paginator.php b/cake/libs/view/helpers/paginator.php index 59acc1f49..c7377e13e 100644 --- a/cake/libs/view/helpers/paginator.php +++ b/cake/libs/view/helpers/paginator.php @@ -252,6 +252,10 @@ class PaginatorHelper extends AppHelper { * @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); } @@ -271,6 +275,10 @@ class PaginatorHelper extends AppHelper { * @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); }