Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Remove the Bootstrap 3 dependency #42

Open
ivan-cc opened this issue May 29, 2018 · 1 comment
Open

Remove the Bootstrap 3 dependency #42

ivan-cc opened this issue May 29, 2018 · 1 comment

Comments

@ivan-cc
Copy link

ivan-cc commented May 29, 2018

I use Bootstrap 4 (throgh a component). After I start using your component, Bootstrap 3 connects and my styles get overriden.

It happens because your component uses dependency in src/SelectizeAsset.php
'yii\bootstrap\BootstrapAsset'

Is it possible to remove this dependency or make it optional?

PS: also it would be great to be able to disconnect/change (in src/SelectizeAsset.php) css-file
'css/selectize.bootstrap3.css'

@chtidom
Copy link

chtidom commented Feb 14, 2019

Hi,

I encountered the same problem and eventually came to a solution.
You can extend the component and the assets file.
Then call your own asset file in the registerClientScript() method of the component and override the original assets call doing:

public function init()
{
    parent::init();
    // resetting BootstrapAsset to not load own css and js files
    \Yii::$app->assetManager->bundles['yii\\bootstrap\\BootstrapAsset'] = [
        'css' => [],
        'js' => []
    ];
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants