亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

詳解Yii2高級(jí)版引入bootstrap.js的一個(gè)辦法

 更新時(shí)間:2017年03月21日 16:32:07   作者:沐風(fēng)待雨  
本篇文章主要介紹了詳解Yii2高級(jí)版引入bootstrap.js的一個(gè)辦法,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下。

在frontend/assets/AppAsset.php

代碼示例

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 文件里

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了

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論