PHPackages                             jinhongtl/yii2-lottery - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. jinhongtl/yii2-lottery

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

jinhongtl/yii2-lottery
======================

v1.0.1(4y ago)311MITPHP

Since Apr 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jinhongtl/yii2-lottery)[ Packagist](https://packagist.org/packages/jinhongtl/yii2-lottery)[ RSS](/packages/jinhongtl-yii2-lottery/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (2)Used By (0)

Lottery Framework for Yii 2 - 基于Yii2的通用抽奖框架
===========================================

[](#lottery-framework-for-yii-2---基于yii2的通用抽奖框架)

这是一个基于Yii2的通用抽奖框架，连接不同的组件以支持抽奖

安装
--

[](#安装)

```
php composer.phar require  jinhongtl/yii2-lottery

```

使用
--

[](#使用)

- 配置抽奖组件
- 创建一个类实现lottery\\LotteryInterface接口
- 配置抽奖算法(有默认抽奖算法，可省略)

### 配置

[](#配置)

```
'components' => [
    'lottery' => [
        'class' => 'lottery\Lottery',
        'lotteryClass' => 'micro\controllers\RushLottery',
    ],
]

```

### 抽奖接口

[](#抽奖接口)

```
