Zebra_PaginationPHP分页类
Zebra_Pagination 是一个通用的 PHP 类,用来根据记录数和每页显示数自动生成分页链接。
示例代码:
<?php // let's paginate data from an array... $countries = array( // array of countries ); // how many records should be displayed on a page? $records_per_page = 10; // include the pagination class require 'path/to/Zebra_Pagination.php'; // instantiate the pagination object $pagination = new Zebra_Pagination(); // the number of total records is the number of records in the array $pagination->records(count($countries)); // records per page $pagination->records_per_page($records_per_page); // here's the magick: we need to display *only* the records for the current page $countries = array_slice( $countries, (($pagination->get_page() - 1) * $records_per_page), $records_per_page ); ?> <table> <tr><th>Country</th></tr> <?php foreach ($countries as $index => $country):?> <tr<?php echo $index % 2 ? ' class="even"' : '')?>> <td><?php echo $country?></td> </tr> <?php endforeach?> </table> <?php // render the pagination links $pagination->render(); ?>
评论
PHPPagePHP 分页类
一个简单好用的PHP分页类。多年前,我刚开始接触编程时,分页就是一个不小的挑战。还好很多框架都自带了分页类,帮我省去了很多麻烦。事实上,写好一个分页类不是那么容易,往往看起来简单的事做起来却不那么简单
PHPPagePHP 分页类
0
jqPageNavigaterjQuery 分页插件
jqPageNavigater首先要说明的是,这插件本来是写给自己玩的,所以代码质量什么的是很渣的...各位大神别喷呀这是一个简单的jQuery分页栏,没有实现很多的功能,样式也很简单,实现自定义比较
jqPageNavigaterjQuery 分页插件
0
jBootstrapPageBootstrap分页控件
一个Bootstrap风格的分页控件,对于喜欢Bootstrap简洁美观和扁平化的同学可以关注jBootstrapPage,目前jBootstrapPage最新版为V0.1,后续还有更多功能需要完善。
jBootstrapPageBootstrap分页控件
0
MvcPagerASP.NET分页控件
MvcPager分页控件是在ASP.NETMVC Web应用程序中实现分页功能的一系列扩展方法,该分页控件的最初的实现方法借鉴了网上流行的部分源代码,尤其是ScottGu的PagedList<T
MvcPagerASP.NET分页控件
0
PICollectionPageViewiOS 分页视图
PICollectionPageView 是一个基于 UICollectionView 的分页视图。
PICollectionPageViewiOS 分页视图
0
LLSlideViewController分页控件
LLSlideViewController 是一个新的分页控件,替代了 UIPageViewCont
LLSlideViewController分页控件
0