1.在配置文件components中配置(jquery放入到head标签中)

'assetManager'=>[
        'bundles'=>[
            'yii\web\JqueryAsset'=>[
          //'sourcePath' => null,'js' => [],不使用默认jquery
'jsOptions'=>[ 'position'=>\yii\web\View::POS_HEAD, //head中 ] ] ] ],

2.在assets/xxxAsset.php文件中添加属性(此文件引入及依赖的js都会放到head标签中)

public $jsOptions=[
    'position'=>\yii\web\View::POS_HEAD,
];

3.移除依赖(移除依赖的库)

public $depends = [
   //'yii\web\YiiAsset',              #REMOVE
   //'yii\bootstrap\BootstrapAsset',  #REMOVE
];

 <?php $this->head(); ?> 模版中添加此句代码来放置css的位置

posted on 2015-04-29 14:16  浊浊然  阅读(1631)  评论(0编辑  收藏  举报