cakephp3-bootstrap-helpers icon indicating copy to clipboard operation
cakephp3-bootstrap-helpers copied to clipboard

Generated links for next and previous page neglects url option

Open Antoniossss opened this issue 8 years ago • 4 comments

using version 3.0.7 For example i have following options:

$paginationOptions = [
    "size" => "small",
    "prev" => "<",
    "next" => ">",
    "ellipsis" => true,
    "first" => "first",
    "last" => "last",
    "url" => [
        "#" => "results-panel"
    ]
];

And I use it like this: $this->Paginator->numbers($paginationOptions);

Links like 1,2,3,4,5.... etc contains proper anchor #results-panel. Previous and next links on the other hand does not.

Antoniossss avatar Jun 01 '17 13:06 Antoniossss

Do first and last link have the anchor set appropriately?

Holt59 avatar Jun 01 '17 13:06 Holt59

I have just checked that and no, they do not.

Antoniossss avatar Jun 01 '17 13:06 Antoniossss

For next and prev, you can do the following:

$paginationOptions = [
    'next' => [
        'title' => '<',
        'url' => ['#' => 'results-panel']
    ]
]

I only forward first and last to the standard PaginatorHelper::numbers() methods, so I don't know if it will also work with first and last.

Holt59 avatar Jun 02 '17 09:06 Holt59

Digging a bit into the standard paginator helper, you may be able to do (not tested, not really sure... ):

$this->Paginator->options(['url' => ['#' => 'results-panel']]);
echo $this->Paginator->numbers($paginationOptions);

Holt59 avatar Jun 02 '17 09:06 Holt59