Viewed   256 times

Same as title, i don't want using bootstrap.css and bootstrap.js. I try using:

'assetManager' => [
    'bundles' => [
        'yiibootstrapBootstrapAsset' => [
            'css' => [],
        ],
    ],
],

It remove bootstrap.css but can't remove bootstrap.js. Somebody can help me?

 Answers

3

In web.php config file add the following code into components array:

'assetManager' => [
        'bundles' => [
            'yiibootstrapBootstrapPluginAsset' => [
                'js'=>[]
            ],
        ],
    ],

To be more comprehensive:

in order to disable Css (bootstrap.css):

'assetManager' => [
    'bundles' => [
        'yiibootstrapBootstrapAsset' => [
            'css' => [],
        ],
    ],
],

in order to disable JS (bootstrap.js):

'assetManager' => [
    'bundles' => [
        'yiibootstrapBootstrapPluginAsset' => [
            'js'=>[]
        ],
    ],
],

in order to disable JQuery (jquery.js)

'assetManager' => [
    'bundles' => [
        'yiiwebJqueryAsset' => [
            'js'=>[]
        ],
    ],
],

In order to have all of them disabled:

'assetManager' => [
    'bundles' => [
        'yiiwebJqueryAsset' => [
            'js'=>[]
        ],
        'yiibootstrapBootstrapPluginAsset' => [
            'js'=>[]
        ],
        'yiibootstrapBootstrapAsset' => [
            'css' => [],
        ],

    ],
],

UPDATE

As Soju mentioned in comments, another alternative way would be disabling these files in AppAsset class, which is located in ./assets/, then remove the following lines:

public $depends = [
   'yiiwebYiiAsset',              #REMOVE
   'yiibootstrapBootstrapAsset',  #REMOVE
];
Saturday, August 27, 2022
2

It depends from what do you mean by integrating: if you mean just including the CSS and JS files, just download them,include them in your assets folder and require them from you templates.

If you want to have control over the way the LESS/SASSS source is generated, you may be interested on this bundle [which did magically show up as the first result after googling for "symfony bootstrap"].

Tuesday, November 8, 2022
 
3
$(".container>parent").click(function() {
    $('.element').css({
        'animation': 'fadeInUp .2s',
        '-webkit-animation': 'fadeInUp .2s'
    });

    setTimeout(function(){
        $('.element').removeAttr('style');
    },300);
});
Saturday, November 26, 2022
 
pcz5
 
5

I think a good php framework that would allow you to use Twitter's Bootstrap is Symfony2 http://symfony.com/. They have a client-side resource management system called Assetic which allows you to package up any libraries you wish. So while it does not provide integration with twitters client-side framework it does allow you to write your own. Check it out at http://symfony.com/doc/current/cookbook/assetic. Hope that helps.

Tuesday, August 30, 2022
 
5

#header_wrapper has width fixed at 950px, and #logo and #nav are floated within it. Since #logo is 250px, that leaves 700px for what's in #nav (whose elements are also floated).

Everything fits just fine until the 'Products' submenu becomes visible. Then its .headlink becomes much wider, due to the extra content, which pushes the overall size of #nav to where it is forced down to the next "line", below #logo. This is the way floated elements work; they fill up the space horizontally until some block is too big and gets pushed down below the first one.

The flicker results from the fact that :hover is no longer active and the submenu gets hidden. Then everything goes back to the way it was. Except that the mouse pointer is still there, and so now :hover is active again. Repeat.

I'm not sure how I'd fix it, but that appear to me to be what's wrong. Maybe you could alter the way your elements are nested, or don't float the nav section. For a quick fix, you could change the #header_wrapper width to something much bigger, such as 1450px, just to see how the 'Products' submenu is behaving, and work out its kinks.

Tuesday, October 25, 2022
 
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :