Test Failed
Push — master ( 4a086f...4834ec )
by vistart
05:02
created

SetUpFormWidget::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
namespace rhosocial\organization\widgets;
14
15
use rhosocial\organization\forms\SetUpForm;
16
use Yii;
17
use yii\base\Widget;
18
19
/**
20
 * @version 1.0
21
 * @author vistart <[email protected]>
22
 */
23
class SetUpFormWidget extends Widget
24
{
25
    public $model;
26
27
    /**
28
     * @inheritdoc
29
     */
30
    public function init()
31
    {
32
        if (!$this->model) {
33
            $this->model = new SetUpForm(['user' => Yii::$app->user->identity]);
34
        }
35
    }
36
37
    /**
38
     * @inheritdoc
39
     */
40
    public function run()
41
    {
42
        return $this->render('set-up-form-widget', ['model' => $this->model]);
43
    }
44
}
45