// This condition can be removed in real project's source code. break; } } // endforeach; unset($item, $key, $newdata); ?> </tbody> </table> <?php if ($i > 500) { echo '<div class="alert">You are displaying too many items per page! This is for prevent your system use too much resources so it limits the items per page at 500.</div>' . "\n"; } // create pagination links. echo $Pagination->createLinks(); ?> <div class="example-source-code-block"> <h3>Source code</h3> <pre><code class="language-php"><?php $Pagination = new \Rundiz\Pagination\Pagination(); // Set options to the pagination class. $Pagination->base_url = '<?php echo $base_url; ?> ';// *This property must be set. $Pagination->total_records = <?php echo $total_records; ?>
$Pagination->number_tag_open = '<li>'; $Pagination->overall_tag_close = '</ul>'; $Pagination->overall_tag_open = '<ul class="pagination">' . "\n"; $Pagination->page_number_type = $page_number_type; $Pagination->previous_page_always_show = true; $Pagination->previous_page_text = '<'; $Pagination->previous_tag_close = '</li>' . "\n"; $Pagination->previous_tag_open = '<li class="previous">'; $Pagination->unavailable_after = 3; $Pagination->unavailable_before = 1; $Pagination->unavailable_display = true; $Pagination->unavailable_tag_close = '</a></li>' . "\n"; $Pagination->unavailable_tag_open = '<li class="unavailable"><a>'; $Pagination->unavailable_text = '..'; // create pagination links. echo $Pagination->createLinks(':pagination'); // clear style. $Pagination->clear(); ?> </div> <h4>Select box style</h4> <p>This example just get pagination data and render in your own style.</p> <div class="each-example-block"> <?php $Pagination = new \Rundiz\Pagination\Pagination(); // Set options to the pagination class. $Pagination->base_url = $base_url; // *This property must be set. $Pagination->total_records = $total_records;