Difference between #4 and #5 of
Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Revision #5 has been created by Kartik V on Apr 14, 2014, 11:33:22 AM with the memo:

Yii object configuration change
« previous (#4) next (#6) »

Changes

Title unchanged

Override/Eliminate Bootstrap CSS/JS for Yii 2.0 widgets

Category unchanged

How-tos

Yii version unchanged

Tags unchanged

yii 2, Widgets, bootstrap, style, customize, theme

Content changed

[...]
For other Yii widgets that are not part of an inbuilt Yii extension (like bootstrap or JUI), the widget itself does not have any CSS inbuilt. Rather the widget uses Bootstrap HTML markup as default which you can override.

An example of customizing the Yii GridView is mentioned here. You can easily override Bootstrap or other styling defaults by changing the GridView default options.

### Option 1: Updating object DI config
The simpler direct approach for you would be to override defaults for Yii's class
es in any place before using them configuration. You may use [\Yii::$container->set](http://www.yiiframework.com/doc-2.0/yii-baseyii.html#$container-detail "Yii DI Container") to set up the needed dependencies of classes and their initial property values. For global use - you can set this in your webroot index.php or the config file.


```php
// Set GridView defaults
\Yii::$container->set('yii\grid\GridView', [
[...]
4 2
39 followers
Viewed: 55 676 times
Version: 2.0
Category: How-tos
Written by: Kartik V
Last updated by: CeBe
Created on: Feb 27, 2014
Last updated: 6 years ago
Update Article

Revisions

View all history