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.
when i add a package to yii
This is how we register booty assets.
namespace backend\assets;
use yii\web\AssetBundle;
class BootstrapAsset extends AssetBundle
{
public $sourcePath = '@bower/bootstrap/dist';
public $js = [
'js/bootstrap.min.js',
];
}
And Register this asset in your layout as:
$asset = AppAsset::register($this);
$bootstrap = \backend\assets\BootstrapAsset::register($this);
Hope this will give a hint.