定制 rogerthomas84/ohpage 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

rogerthomas84/ohpage

最新稳定版本:1.0.0

Composer 安装命令:

composer require rogerthomas84/ohpage

包简介

OhPage is a paginating library for PHP

README 文档

README

OhPage is a simple cheat, really it's because I'm tired of figuring out the skip / limit for paginating result sets.

Latest Stable Version Total Downloads Latest Unstable Version License Build Status

Using Composer

To use OhPage with Composer, add the dependency (and version constraint) to your require block inside your composer.json file.

{
    "require": {
        "rogerthomas84/ohpage": "1.0.*"
    }
}

Quick Start

<?php
$db = new \MongoClient('mongodb://my.database.host:27017'); // Set up your database connection
$collection = $db->selectCollection('mydb', 'mycollection');

$perPage = 10; // How many results per page?
$currentPage = 1; // The current page
$totalResults = $collection->count(); // Get the total from the DB

$instance = new PaginateHelper($perPage, $currentPage, $totalResults);

$results = $collection->find()->sort(
    array('createdDate' => -1)
)->skip(
    $instance->getQueryOffset()
)->limit(
    $instance->getQueryLimit()
);

统计信息

  • 总下载量: 61
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-09-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固