Skip to content

Instantly share code, notes, and snippets.

@ss22219
Created October 7, 2013 19:30
Show Gist options
  • Save ss22219/6873559 to your computer and use it in GitHub Desktop.
Save ss22219/6873559 to your computer and use it in GitHub Desktop.
<?php
require_once 'Page.class.php';
$page = new Page(array("<h3>demo is not list</h3>"), (key_exists("page", $_GET) ? $_GET["page"] : 1), 12, 1000, 8);
echo "Page index: <font color='red'>" . $page->getPageIndex() . "</font> PageTotal page: <font color='red'>" . $page->getTotalPage() . "</font></br >";
echo "<br />page list:<br /><br />";
foreach ($page->getList() as $item) {
echo $item . "<br />";
}
echo "<br/>";
echo "<a href='?page=1'>home</a> ";
foreach ($page->getPageLabels() as $label) {
if ($label == $page->getPageIndex()) {
echo "<a href='?page=" . $label . "'><font color='#ccc'>" . $label . "</font></a> ";
} else {
echo "<a href='?page=" . $label . "'>" . $label . "</a> ";
}
}
echo "<a href='?page=" . $page->getTotalPage() . "'>end</a> ";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment