forked from philippfrenzel/yii2fullcalendar
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CoreAsset.php
45 lines (39 loc) · 1.14 KB
/
CoreAsset.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace yii2fullcalendar;
use yii\web\AssetBundle;
/**
* @link http://www.frenzel.net/
* @author Philipp Frenzel <[email protected]>
*/
class CoreAsset extends AssetBundle
{
/**
* tell the calendar, if you like to render google calendar events within the view
* @var boolean
*/
public $googleCalendar = false;
/**
* [$js description]
* @var array
*/
public $js = [
// Fullcalendar doesn't distribute prebuilt js anymore, will eventually require
// embedding assets in the extension
// https://github.com/fullcalendar/fullcalendar/issues/4566
'https://cdn.jsdelivr.net/npm/[email protected]/index.global.min.js',
'https://cdn.jsdelivr.net/npm/@fullcalendar/[email protected]/locales-all.global.min.js',
];
/**
* @inheritdoc
*/
public function registerAssetFiles($view)
{
// Serve unminified files when YII_DEBUG
if (YII_DEBUG) {
foreach ($this->js as $jsk => $jsfile) {
$this->js[$jsk] = str_replace(".min", "", $jsfile);
}
}
parent::registerAssetFiles($view);
}
}