Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Pagination and anchor hashtag
  • Hello!

    I decide to use in my page Pagination class, but encountered with one strange problem.

    By design it has some html section in the middle of all page. It sets visible by anchor hashtag at the end of URI, for example "http://localhost/main/report#m". And there is placed some table data in this section. It is needed to be paged.

    Can I add the hashtag "#m" at the end of all link in pager for right positioning of page?
  • Solve this with regural expression:

    preg_replace('/(href=\"(?:[^#"]*))(#?)(\")/', '\1#m\3', $pagination->pages_render())

    but always want beautiful solution, not with crutches ;)
  • Have you tried just adding it to the pagination URL?

    You can add a dummy page number to it if needed, like "http://localhost/main/report/0#m", the Pagination class will replace the 0 in this example by the correct page number (if you set the URI segment to 3).

  • Yes. Pagination reduce '#' char from uri. "http://localhost/main/report/0#m" changes to "http://localhost/main/report/0m".
  • Could you document this issue, and report it at https://github.com/fuel/core/issues so it can be looked at?
  • I'll try. I never do this earlier and English is not native for me... But, I think, I must to try :)

  • HarroHarro
    Accepted Answer
    I've seen a fix has already been comitted. ;-)
  • Thank you. How I have to switch at 1.8/develop branch?
    git co 1.8/develop
    git pull
    ?
  • HarroHarro
    Accepted Answer
    Yup. Or backport only the pagination class, I don't think it has dependencies.

    If you switch the core to 1.8/dev, you should also switch all fuel packages to 1.8/dev, to keep everything consistent.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion