Completed
Push — master ( 4fbc1b...ef5514 )
by Andrii
03:11
created

OrganizationLink::run()   A

Complexity

Conditions 2
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 9.4285
cc 2
eloc 5
nc 1
nop 0
crap 6
1
<?php
2
3
/*
4
 * Theme Manager for Yii2
5
 *
6
 * @link      https://github.com/hiqdev/yii2-thememanager
7
 * @package   yii2-thememanager
8
 * @license   BSD-3-Clause
9
 * @copyright Copyright (c) 2015-2016, HiQDev (http://hiqdev.com/)
10
 */
11
12
namespace hiqdev\thememanager\widgets;
13
14
use Yii;
15
use yii\base\Widget;
16
use yii\helpers\Html;
17
18
class OrganizationLink extends Widget
19
{
20
    /**
21
     * @var string|array url to organization.
22
     */
23
    public $url;
24
25
    /**
26
     * @var string name to display.
27
     */
28
    public $name;
29
30
    /**
31
     * @var array html options.
32
     */
33
    public $options = [];
34
35
    public function run()
36
    {
37
        return $this->render('OrganizationLink', [
38
            'url'     => $this->url,
39
            'name'    => $this->name ?: 'Organization',
40
            'options' => $this->options,
41
        ]);
42
    }
43
}
44