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

Wrong links for pager #2016

Closed
penguinpower80 opened this issue May 18, 2019 · 1 comment
Closed

Wrong links for pager #2016

penguinpower80 opened this issue May 18, 2019 · 1 comment

Comments

@penguinpower80
Copy link

When CI is running from a subdirectory, the pager links are incorrect and missing the subdirector(ies) in URI.

CodeIgniter 4 version
4.0.0-beta.2

Affected module(s)
PAGER

Expected behavior, and steps to reproduce if appropriate
Base url: http://mysite.com
CI in subfolder "ci/v4", so final url for site is "http://mysite.com/ci/v4/"

In view, calling "$pager->links()", using all other default settings, pagination links are:

  • 2
  • and should be:

  • 2
  • In my app.php AND .env file, I have app.baseURL set to "http://mysite.com/ci/v4/

    If I run $page->setPath( 'ci/v4//' ) prior to output, then it is correct. but it hardcodes the uri which isn't desirable.

    Context

    • Mac OSX 10.12.6
    • Apache 2.4.29
    • PHP 7.2.17
    @jim-parry jim-parry added this to the 4.0.0-rc.2 milestone Sep 8, 2019
    @jim-parry
    Copy link
    Contributor

    Pagination does not use the baseURL property.
    It is instead based on the current URL, i.e. the page you are on when the links are requested.
    I have added additional unit tests to show that this is working as intended.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants