yii\web\AssetBundle::init PHP Method

init() public method

If you override this method, make sure you call the parent implementation in the last.
public init ( )
    public function init()
    {
        if ($this->sourcePath !== null) {
            $this->sourcePath = rtrim(Yii::getAlias($this->sourcePath), '/\\');
        }
        if ($this->basePath !== null) {
            $this->basePath = rtrim(Yii::getAlias($this->basePath), '/\\');
        }
        if ($this->baseUrl !== null) {
            $this->baseUrl = rtrim(Yii::getAlias($this->baseUrl), '/');
        }
    }

Usage Example

 /**
  * @inheritdoc
  */
 public function init()
 {
     $this->setSourcePath('@vendor/branchonline/yii2-select2/assets/select2');
     $this->setupAssets('css', ['select2']);
     $this->setupAssets('js', ['select2.min']);
     parent::init();
 }
All Usage Examples Of yii\web\AssetBundle::init