|
27 | 27 | class BootstrapPaginatorHelper extends PaginatorHelper { |
28 | 28 |
|
29 | 29 | use BootstrapTrait ; |
30 | | - |
31 | | - public function __construct ($view, $config = []) { |
32 | | - $this->templates([ |
| 30 | + |
| 31 | + /** |
| 32 | + * Default config for this class |
| 33 | + * |
| 34 | + * Options: Holds the default options for pagination links |
| 35 | + * |
| 36 | + * The values that may be specified are: |
| 37 | + * |
| 38 | + * - `url` Url of the action. See Router::url() |
| 39 | + * - `url['sort']` the key that the recordset is sorted. |
| 40 | + * - `url['direction']` Direction of the sorting (default: 'asc'). |
| 41 | + * - `url['page']` Page number to use in links. |
| 42 | + * - `model` The name of the model. |
| 43 | + * - `escape` Defines if the title field for the link should be escaped (default: true). |
| 44 | + * |
| 45 | + * Templates: the templates used by this class |
| 46 | + * |
| 47 | + * @var array |
| 48 | + */ |
| 49 | + protected $_defaultConfig = [ |
| 50 | + 'options' => [], |
| 51 | + 'templates' => [ |
33 | 52 | 'nextActive' => '<li><a href="{{url}}">{{text}}</a></li>', |
34 | 53 | 'nextDisabled' => '<li class="disabled"><a>{{text}}</a></li>', |
35 | 54 | 'prevActive' => '<li><a href="{{url}}">{{text}}</a></li>', |
36 | 55 | 'prevDisabled' => '<li class="disabled"><a>{{text}}</a></li>', |
| 56 | + 'counterRange' => '{{start}} - {{end}} of {{count}}', |
| 57 | + 'counterPages' => '{{page}} of {{pages}}', |
37 | 58 | 'first' => '<li><a href="{{url}}">{{text}}</a></li>', |
38 | 59 | 'last' => '<li><a href="{{url}}">{{text}}</a></li>', |
39 | 60 | 'number' => '<li><a href="{{url}}">{{text}}</a></li>', |
40 | | - 'current ' => '<li class="active"><a href="{{url}}">{{text}}</a></li>' |
41 | | - ]); |
42 | | - |
43 | | - parent::__construct($view, $config); |
44 | | - } |
| 61 | + 'current' => '<li class="active"><a href="{{url}}">{{text}}</a></li>', |
| 62 | + 'ellipsis' => '<li class="ellipsis">...</li>', |
| 63 | + 'sort' => '<a href="{{url}}">{{text}}</a>', |
| 64 | + 'sortAsc' => '<a class="asc" href="{{url}}">{{text}}</a>', |
| 65 | + 'sortDesc' => '<a class="desc" href="{{url}}">{{text}}</a>', |
| 66 | + 'sortAscLocked' => '<a class="asc locked" href="{{url}}">{{text}}</a>', |
| 67 | + 'sortDescLocked' => '<a class="desc locked" href="{{url}}">{{text}}</a>', |
| 68 | + ] |
| 69 | + ]; |
45 | 70 |
|
46 | 71 | /** |
47 | 72 | * |
|
0 commit comments