Completed
Push — master ( ab4704...8034fc )
by Cheren
02:16
created

ToolbarHelper::link()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
1
<?php
2
/**
3
 * CakeCMS Core
4
 *
5
 * This file is part of the of the simple cms based on CakePHP 3.
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @package   Core
10
 * @license   MIT
11
 * @copyright MIT License http://www.opensource.org/licenses/mit-license.php
12
 * @link      https://github.com/CakeCMS/Core".
13
 * @author    Sergey Kalistratov <[email protected]>
14
 */
15
16
namespace Core\Toolbar;
17
18
use Core\Utility\Toolbar;
19
20
/**
21
 * Class ToolbarHelper
22
 *
23
 * @package Core\Toolbar
24
 */
25
class ToolbarHelper
26
{
27
28
    /**
29
     * Create link output.
30
     *
31
     * @param string $title
32
     * @param string $url
33
     * @param array $options
34
     */
35
    public static function link($title, $url, array $options = [])
36
    {
37
        $toolbar = Toolbar::getInstance();
38
        $options += [
39
            'icon'   => 'link',
40
            'button' => 'grey lighten-3'
41
        ];
42
43
        $toolbar->appendButton('Core.link', $title, $url, $options);
44
    }
45
}
46