OrganizationLink::run()   A
last analyzed

Complexity

Conditions 2
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

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