Skip to content

Commit

Permalink
Fix paginator options when disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Dec 9, 2014
1 parent 0c788d1 commit dc41a1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lib/Cake/Test/Case/View/Helper/PaginatorHelperTest.php
Expand Up @@ -1006,6 +1006,17 @@ public function testPagingLinks() {
)
);

$result = $this->Paginator->prev('<i class="fa fa-angle-left"></i>', array('escape' => false), null, array('class' => 'prev disabled'));
$expected = array(
'span' => array('class' => 'prev disabled'),
'a' => array('href' => '/', 'rel' => 'prev'),
'i' => array('class' => 'fa fa-angle-left'),
'/i',
'/a',
'/span'
);
$this->assertTags($result, $expected);

$result = $this->Paginator->prev('<< Previous', null, '<strong>Disabled</strong>');
$expected = array(
'span' => array('class' => 'prev'),
Expand Down
2 changes: 1 addition & 1 deletion lib/Cake/View/Helper/PaginatorHelper.php
Expand Up @@ -499,7 +499,7 @@ protected function _pagingLink($which, $title = null, $options = array(), $disab
if (!empty($disabledTitle) && $disabledTitle !== true) {
$title = $disabledTitle;
}
$options = (array)$disabledOptions + $_defaults;
$options = (array)$disabledOptions + $options + $_defaults;
} elseif (!$this->{$check}($options['model'])) {
return '';
}
Expand Down

0 comments on commit dc41a1f

Please sign in to comment.