Yii2 Composer manage package in bower and bower-vendor

后端 未结 3 1565
感情败类
感情败类 2021-01-26 07:44

I have been using yii2 for sometime now but i cant wrap my head around how to manage my packages. I have two issues in these regard.

  1. when i add a package to yii

3条回答
  •  借酒劲吻你
    2021-01-26 08:32

    This can be archived by overwriting the default alias path for bower packages which is @vendor/bower to @vendor/bower/bower-asset.

    This can be done from the web.php file under $config=[]

     'aliases' => [
            '@bower' => '@vendor/bower/bower-asset',
        ],
    

    when you echo

    echo Yii::getAlias('@bower');
    

    it should echo

    /Library/WebServer/Documents/project-name/vendor/bower/bower-asset
    

提交回复
热议问题