定制 sjaakp/yii2-random-provider 二次开发

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

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

sjaakp/yii2-random-provider

最新稳定版本:1.0.2

Composer 安装命令:

composer require sjaakp/yii2-random-provider

包简介

Random ActiveDataProvider for Yii 2.0 GridView or ListView

README 文档

README

ActiveDataProvider with random selection

Latest Stable Version Total Downloads License

RandomProvider is derived from ActiveDataProvider of the Yii 2.0 PHP Framework. It selects the records in a random fashion, which in some cases may be more attractive than the orderly way a regular ActiveDataProvider (usually) does it. RandomProvider is intended to co-operate with my LoadMorePager, but it will work with LinkPager or other pagers as well.

Notice that RandomProvider doesn't support CUBRID or dblib database drivers. Moreover, I only tested it with mysql. I'm pretty sure it'll work with other drivers, though. If you have any experiences to share, I'll appreciate that.

Notice also that RandomProvider makes use of an algorithm named 'Order By Rand()'. This is rather slow, and doesn't scale very well. Therefore, it is advised to use RandomProvider only with relatively small data sets (think of less than a few thousands of records). More information here.

A demonstration of RandomProvider is here.

Installation

Install yii2-random-provider in the usual way with Composer. Add the following to the require section of your composer.json file:

"sjaakp/yii2-random-provider": "*"

or run:

composer require sjaakp/yii2-random-provider

You can manually install yii2-random-provider by downloading the source in ZIP-format.

Using RandomProvider

RandomProvider is a drop-in replacement for Yii's ActiveDataProvider. Just use it like ActiveDataProvider.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-09

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固