Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix incomplete patch 61dd109

  • Loading branch information...
commit 56a0eb04b799bd01b8c9d32698fef1725785ee7f 1 parent 7ea3ee4
@ADmad ADmad authored
View
10 lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
@@ -1690,6 +1690,16 @@ public function testNumbers() {
);
$this->assertTags($result, $expected);
+ $result = $this->Paginator->numbers(array('modulus' => 3, 'currentTag' => 'span', 'tag' => 'li'));
+ $expected = array(
+ array('li' => array('class' => 'current')), array('span' => array()), '1', '/span', '/li',
+ ' | ',
+ array('li' => array()), array('a' => array('href' => '/index/page:2')), '2', '/a', '/li',
+ ' | ',
+ array('li' => array()), array('a' => array('href' => '/index/page:3')), '3', '/a', '/li',
+ );
+ $this->assertTags($result, $expected);
+
$this->Paginator->request->params['paging'] = array(
'Client' => array(
'page' => 2,
View
6 lib/Cake/View/Helper/PaginatorHelper.php
@@ -753,7 +753,11 @@ public function numbers($options = array()) {
if ($class) {
$currentClass .= ' ' . $class;
}
- $out .= $this->Html->tag($tag, $i, array('class' => $currentClass));
+ if ($currentTag) {
+ $out .= $this->Html->tag($tag, $this->Html->tag($currentTag, $i), array('class' => $currentClass));
+ } else {
+ $out .= $this->Html->tag($tag, $i, array('class' => $currentClass));
+ }
} else {
$out .= $this->Html->tag($tag, $this->link($i, array('page' => $i), $options), compact('class'));
}
Please sign in to comment.
Something went wrong with that request. Please try again.