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 <mark@mark-story.com>
This commit is contained in:
Dieter Plaetinck 2010-02-19 10:27:16 +01:00 committed by mark_story
parent 5ce66d3031
commit 65394604a7

View file

@ -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);
}