Completed
Push — master ( 9ed145...8e4a93 )
by vistart
04:04
created

MemberListWidget::init()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
dl 0
loc 6
rs 9.4285
c 1
b 0
f 1
cc 2
eloc 3
nc 2
nop 0
1
<?php
2
3
/**
4
 *  _   __ __ _____ _____ ___  ____  _____
5
 * | | / // // ___//_  _//   ||  __||_   _|
6
 * | |/ // /(__  )  / / / /| || |     | |
7
 * |___//_//____/  /_/ /_/ |_||_|     |_|
8
 * @link https://vistart.me/
9
 * @copyright Copyright (c) 2016 - 2017 vistart
10
 * @license https://vistart.me/license/
11
 */
12
13
14
namespace rhosocial\organization\widgets;
15
16
use Yii;
17
use yii\base\Widget;
18
use yii\data\ActiveDataProvider;
19
use yii\web\ServerErrorHttpException;
20
21
/**
22
 * Class MemberListWidget
23
 * @package rhosocial\organization\widgets
24
 * @version 1.0
25
 * @author vistart <[email protected]>
26
 */
27
class MemberListWidget extends Widget
28
{
29
    /**
30
     * @var ActiveDataProvider
31
     */
32
    public $dataProvider;
33
    public $tips = true;
34
35
    public function init()
36
    {
37
        if (empty($this->dataProvider)) {
38
            throw new ServerErrorHttpException('Invalid Member Provider.');
39
        }
40
    }
41
42
    public function run()
43
    {
44
        return $this->render('member-list', [
45
            'dataProvider' => $this->dataProvider,
46
            'tips' => $this->tips,
47
        ]);
48
    }
49
}
50