Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix Missing 'currentClass' array parameter in paginatorHelper #457

Closed
wants to merge 1 commit into from

3 participants

@budi-khoirudin

Here, I change Manualy!

@rchavik
Collaborator

Ok. looks better. But it was targetted at master which is the stable branch.

Furthermore, currentClass was implemented in the 2.1 branch. :)
It was documented in the book, albeit not immediately obvious:
Changed in version 2.1: The currentClass option was added in 2.1

Thanks.

@rchavik
Collaborator

Please recheck the book again since it now combines features from all 2.0 and 2.1. Version specific changes are already documented.

@rchavik rchavik closed this
@budi-khoirudin

Okay, can u give me, the Url? where it is?

thank you!

@josegonzalez
Collaborator

If you search for currentClass on the url you linked to, you shall find the information on usage.

@budi-khoirudin

Not is that I wanted, but Change Log For version 2.1? for this Method....

@rchavik
Collaborator

You can use gitk to view the history.

Or view from github's: https://github.com/cakephp/cakephp/commits/2.1/lib/Cake/View/Helper/PaginatorHelper.php

@budi-khoirudin

Okay, thank you rchavik, for your information ... , from that i know where is change code ....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 6 deletions.
  1. +9 −6 lib/Cake/View/Helper/PaginatorHelper.php
View
15 lib/Cake/View/Helper/PaginatorHelper.php
@@ -656,7 +656,7 @@ public function numbers($options = array()) {
$defaults = array(
'tag' => 'span', 'before' => null, 'after' => null, 'model' => $this->defaultModel(), 'class' => null,
- 'modulus' => '8', 'separator' => ' | ', 'first' => null, 'last' => null, 'ellipsis' => '...',
+ 'modulus' => '8', 'separator' => ' | ', 'first' => null, 'last' => null, 'ellipsis' => '...', 'currentClass' => 'current'
);
$options += $defaults;
@@ -670,7 +670,7 @@ public function numbers($options = array()) {
extract($options);
unset($options['tag'], $options['before'], $options['after'], $options['model'],
$options['modulus'], $options['separator'], $options['first'], $options['last'],
- $options['ellipsis'], $options['class']
+ $options['ellipsis'], $options['class'], $options['currentClass']
);
$out = '';
@@ -704,10 +704,13 @@ public function numbers($options = array()) {
. $separator;
}
- $currentClass = 'current';
- if ($class) {
- $currentClass .= ' ' . $class;
- }
+ if (!$currentClass) {
+ $currentClass = 'current';
+
+ if ($class) {
+ $currentClass .= ' ' . $class;
+ }
+ }
$out .= $this->Html->tag($tag, $params['page'], array('class' => $currentClass));
if ($i != $params['pageCount']) {
$out .= $separator;
Something went wrong with that request. Please try again.