AssetBundle.php
787 Bytes
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
<?php
/**
* AssetBundle.php
* @author Revin Roman
* @link https://rmrevin.ru
*/
namespace rmrevin\yii\fontawesome;
/**
* Class AssetBundle
* @package rmrevin\yii\fontawesome
*/
class AssetBundle extends \yii\web\AssetBundle
{
/**
* @inherit
*/
public $sourcePath = '@bower/fontawesome';
/**
* @inherit
*/
public $css = [
'css/font-awesome.min.css',
];
/**
* Initializes the bundle.
* Set publish options to copy only necessary files (in this case css and font folders)
* @codeCoverageIgnore
*/
public function init()
{
parent::init();
$this->publishOptions['beforeCopy'] = function ($from, $to) {
return preg_match('%(/|\\\\)(fonts|css)%', $from);
};
}
}