在frontend/assets/AppAsset.php
代码示例
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
namespace frontend\assets; use yii\web\AssetBundle; /** * Main frontend application asset bundle. */ class AppAsset extends AssetBundle { public $basePath = '@webroot' ; public $baseUrl = '@web' ; public $css = [ 'css/site.css' , ]; public $js = [ 'js/main.js' , ]; public $depends = [ 'yii\web\YiiAsset' , 'yii\bootstrap\BootstrapAsset' , //注意这里必须要有 'rmrevin\yii\fontawesome\AssetBundle' , ]; } |
在vendor/yiisoft/yii2-bootstrap/BootstrapAsset.php 文件里
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
namespace yii\bootstrap; use yii\web\AssetBundle; /** * Asset bundle for the Twitter bootstrap css files. * * @since 2.0 */ class BootstrapAsset extends AssetBundle { public $sourcePath = '@bower/bootstrap/dist' ; public $css = [ 'css/bootstrap.css' , ]; //下面是增加的代码 public $js = [ 'js/bootstrap.js' , ]; } |
OK了
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持服务器之家。
原文链接:http://www.yiichina.com/tutorial/1169