Skip to content

Additional pagination on top of the table#11

Open
GreeenPeppper wants to merge 1 commit into
php:masterfrom
GreeenPeppper:patch-1
Open

Additional pagination on top of the table#11
GreeenPeppper wants to merge 1 commit into
php:masterfrom
GreeenPeppper:patch-1

Conversation

@GreeenPeppper
Copy link
Copy Markdown

I've added an additional pagination bar on top of the table because I personally find it very annoying scrolling down the whole page to go to the next one

I've added an additional pagination bar on top of the table because I personally find it very annoying scrolling down the whole page to go to the next one
Comment thread index.php
<a class="pagination prev" href="?page=<?php echo $page-1?>">« Previous page</a>
<?php endif ?>
<span class="page"><?php echo $page ?></span>
<?php if ($x == 49): ?>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable $x is not yet defined here. Also, it will only be 49 after the foreach loop (when looping over a full "page" of users).

Comment thread index.php
<?php endif ?>
<span class="page"><?php echo $page ?></span>
<?php if ($x == 49): ?>
<a class="pagination next" href="?page=<?php echo ++$page?>">Next page »</a>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mutating the $page variable here means that it has the wrong value when used (and incremented again) later on.

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

Successfully merging this pull request may close these issues.

2 participants