Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated links for next and previous page neglects url option #131

Open
Antoniossss opened this issue Jun 1, 2017 · 4 comments
Open

Generated links for next and previous page neglects url option #131

Antoniossss opened this issue Jun 1, 2017 · 4 comments

Comments

@Antoniossss
Copy link

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.

@Holt59
Copy link
Collaborator

Holt59 commented Jun 1, 2017

Do first and last link have the anchor set appropriately?

@Antoniossss
Copy link
Author

Antoniossss commented Jun 1, 2017

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

@Holt59
Copy link
Collaborator

Holt59 commented Jun 2, 2017

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
Copy link
Collaborator

Holt59 commented Jun 2, 2017

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 Holt59 added enhancement and removed bug labels Jul 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants