@@ -582,6 +582,7 @@ public function counter($options = array()) {
582
582
* links to generate
583
583
* - `last` Whether you want last links generated, set to an integer to define the number of 'last'
584
584
* links to generate
585
+ * - `ellipsis` Ellipsis content, defaults to '...'
585
586
*
586
587
* @param mixed $options Options for the numbers, (before, after, model, modulus, separator)
587
588
* @return string numbers string.
@@ -595,7 +596,7 @@ public function numbers($options = array()) {
595
596
596
597
$ defaults = array (
597
598
'tag ' => 'span ' , 'before ' => null , 'after ' => null , 'model ' => $ this ->defaultModel (),
598
- 'modulus ' => '8 ' , 'separator ' => ' | ' , 'first ' => null , 'last ' => null ,
599
+ 'modulus ' => '8 ' , 'separator ' => ' | ' , 'first ' => null , 'last ' => null , ' ellipsis ' => ' ... ' ,
599
600
);
600
601
$ options += $ defaults ;
601
602
@@ -608,7 +609,9 @@ public function numbers($options = array()) {
608
609
609
610
extract ($ options );
610
611
unset($ options ['tag ' ], $ options ['before ' ], $ options ['after ' ], $ options ['model ' ],
611
- $ options ['modulus ' ], $ options ['separator ' ], $ options ['first ' ], $ options ['last ' ]);
612
+ $ options ['modulus ' ], $ options ['separator ' ], $ options ['first ' ], $ options ['last ' ],
613
+ $ options ['ellipsis ' ]
614
+ );
612
615
613
616
$ out = '' ;
614
617
@@ -628,7 +631,7 @@ public function numbers($options = array()) {
628
631
if ($ first && $ start > 1 ) {
629
632
$ offset = ($ start <= (int )$ first ) ? $ start - 1 : $ first ;
630
633
if ($ offset < $ start - 1 ) {
631
- $ out .= $ this ->first ($ offset , array ('tag ' => $ tag , 'separator ' => $ separator ));
634
+ $ out .= $ this ->first ($ offset , array ('tag ' => $ tag , 'separator ' => $ separator, ' ellipsis ' => $ ellipsis ));
632
635
} else {
633
636
$ out .= $ this ->first ($ offset , array ('tag ' => $ tag , 'after ' => $ separator , 'separator ' => $ separator ));
634
637
}
@@ -661,7 +664,7 @@ public function numbers($options = array()) {
661
664
if ($ last && $ end < $ params ['pageCount ' ]) {
662
665
$ offset = ($ params ['pageCount ' ] < $ end + (int )$ last ) ? $ params ['pageCount ' ] - $ end : $ last ;
663
666
if ($ offset <= $ last && $ params ['pageCount ' ] - $ end > $ offset ) {
664
- $ out .= $ this ->last ($ offset , array ('tag ' => $ tag , 'separator ' => $ separator ));
667
+ $ out .= $ this ->last ($ offset , array ('tag ' => $ tag , 'separator ' => $ separator, ' ellipsis ' => $ ellipsis ));
665
668
} else {
666
669
$ out .= $ this ->last ($ offset , array ('tag ' => $ tag , 'before ' => $ separator , 'separator ' => $ separator ));
667
670
}
@@ -696,6 +699,7 @@ public function numbers($options = array()) {
696
699
* - `before` Content to insert before the link/tag
697
700
* - `model` The model to use defaults to PaginatorHelper::defaultModel()
698
701
* - `separator` Content between the generated links, defaults to ' | '
702
+ * - `ellipsis` Content for ellipsis, defaults to '...'
699
703
*
700
704
* @param mixed $first if string use as label for the link, if numeric print page numbers
701
705
* @param mixed $options
@@ -708,6 +712,7 @@ public function first($first = '<< first', $options = array()) {
708
712
'after ' => null ,
709
713
'model ' => $ this ->defaultModel (),
710
714
'separator ' => ' | ' ,
715
+ 'ellipsis ' => '... ' ,
711
716
),
712
717
(array )$ options );
713
718
@@ -718,13 +723,13 @@ public function first($first = '<< first', $options = array()) {
718
723
return false ;
719
724
}
720
725
extract ($ options );
721
- unset($ options ['tag ' ], $ options ['after ' ], $ options ['model ' ], $ options ['separator ' ]);
726
+ unset($ options ['tag ' ], $ options ['after ' ], $ options ['model ' ], $ options ['separator ' ], $ options [ ' ellipsis ' ] );
722
727
723
728
$ out = '' ;
724
729
725
730
if (is_int ($ first ) && $ params ['page ' ] > $ first ) {
726
731
if ($ after === null ) {
727
- $ after = ' ... ' ;
732
+ $ after = $ ellipsis ;
728
733
}
729
734
for ($ i = 1 ; $ i <= $ first ; $ i ++) {
730
735
$ out .= $ this ->Html ->tag ($ tag , $ this ->link ($ i , array ('page ' => $ i ), $ options ));
@@ -749,6 +754,7 @@ public function first($first = '<< first', $options = array()) {
749
754
* - `before` Content to insert before the link/tag
750
755
* - `model` The model to use defaults to PaginatorHelper::defaultModel()
751
756
* - `separator` Content between the generated links, defaults to ' | '
757
+ * - `ellipsis` Content for ellipsis, defaults to '...'
752
758
*
753
759
* @param mixed $last if string use as label for the link, if numeric print page numbers
754
760
* @param mixed $options Array of options
@@ -761,6 +767,7 @@ public function last($last = 'last >>', $options = array()) {
761
767
'before ' => null ,
762
768
'model ' => $ this ->defaultModel (),
763
769
'separator ' => ' | ' ,
770
+ 'ellipsis ' => '... ' ,
764
771
),
765
772
(array )$ options );
766
773
@@ -772,14 +779,14 @@ public function last($last = 'last >>', $options = array()) {
772
779
}
773
780
774
781
extract ($ options );
775
- unset($ options ['tag ' ], $ options ['before ' ], $ options ['model ' ], $ options ['separator ' ]);
782
+ unset($ options ['tag ' ], $ options ['before ' ], $ options ['model ' ], $ options ['separator ' ], $ options [ ' ellipsis ' ] );
776
783
777
784
$ out = '' ;
778
785
$ lower = $ params ['pageCount ' ] - $ last + 1 ;
779
786
780
787
if (is_int ($ last ) && $ params ['page ' ] < $ lower ) {
781
788
if ($ before === null ) {
782
- $ before = ' ... ' ;
789
+ $ before = $ ellipsis ;
783
790
}
784
791
for ($ i = $ lower ; $ i <= $ params ['pageCount ' ]; $ i ++) {
785
792
$ out .= $ this ->Html ->tag ($ tag , $ this ->link ($ i , array ('page ' => $ i ), $ options ));
0 commit comments