forked from Shifrin/yii2-noty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotyAsset.php
54 lines (44 loc) · 1.16 KB
/
NotyAsset.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
46
47
48
49
50
51
52
53
54
<?php
/**
* NotyAsset Class File
*
* This is a helper class which is used to register required widget assets.
*
* @author Mohammad Shifreen
* @link http://www.yiiframework.com/extension/yii2-noty/
* @copyright 2016 Mohammed Shifreen
* @license https://github.com/Shifrin/yii2-noty/blob/master/LICENSE.md
*/
namespace shifrin\noty;
use yii\web\AssetBundle;
class NotyAsset extends AssetBundle
{
public $sourcePath = '@bower/noty';
public $animateCss;
public $buttonsCss;
public $fontAwesomeCss;
public $js = [
'js/noty/packaged/jquery.noty.packaged.min.js'
];
public $depends = [
'yii\web\YiiAsset',
];
/**
* @inheritdoc
* Register css files as per the request
* @param \yii\web\View $view
*/
public function registerAssetFiles($view)
{
if ($this->animateCss) {
$this->css[] = 'demo/animate.css';
}
if ($this->fontAwesomeCss) {
$this->css[] = 'demo/font-awesome/css/font-awesome.min.css';
}
if ($this->buttonsCss) {
$this->css[] = 'demo/buttons.css';
}
parent::registerAssetFiles($view);
}
}