Completed
Pull Request — master (#36)
by resu
12:13
created

LeafLetAsset::init()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 2

Importance

Changes 3
Bugs 0 Features 1
Metric Value
c 3
b 0
f 1
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 2
eloc 2
nc 2
nop 0
crap 2
1
<?php
2
/**
3
 * @copyright Copyright (c) 2013-2015 2amigOS! Consulting Group LLC
4
 * @link http://2amigos.us
5
 * @license http://www.opensource.org/licenses/bsd-license.php New BSD License
6
 */
7
namespace dosamigos\leaflet;
8
9
use yii\web\AssetBundle;
10
11
/**
12
 * LeafLetAsset Registers widget requires files. Please, use the following in order to override bundles for CDN:
13
 *
14
 * ```
15
 *  return [
16
 *        // ...
17
 *        'components' => [
18
 *            'bundles' => [
19
 *                'dosamigos\leaftlet\LeafLetAsset' => [
20
 *                    'sourcePath' => null,
21
 *                    'js' => [ 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js' ],
22
 *                    'css' => [ 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css' ]
23
 *                ]
24
 *            ]
25
 *        ]
26
 *    ]
27
 * ```
28
 *
29
 * @author Antonio Ramirez <[email protected]>
30
 * @link http://www.ramirezcobos.com/
31
 * @link http://www.2amigos.us/
32
 * @package dosamigos\leaflet
33
 */
34
class LeafLetAsset extends AssetBundle
35
{
36
    public $sourcePath = '@bower/leaflet/dist';
37
38
    public $css = [
39
        'leaflet.css'
40
    ];
41
42 15
    public $js = [
43
        'leaflet-src.js'
44
    ];
45
}