*Asset::register() calls can stay the same.
Although the documentation describes the full process of introducing combined assets to the Yii application, we repeat it here to bring a lot more detail to this really complex process.
components.assetManager.bundles setting (read about it in the documentation) telling Yii to use this special, newly-created asset bundle instead of all of the usual bundles.
\yii\console\controllers\AssetController class, which provides you with the
./yii asset command, encapsulates and automates the procedure of asset compilation. It even deals with the issue of files referenced from the CSS code for you, which is really amazing.
Let’s see what we need to do to accomplish this. First, we remember the HTML structure we have when accessing a route at our application, for example
/site/login. The following picture is a screenshot from Firebug in which we see the number of elements our UI consists of:
You can see both Twitter Bootstraps and our own stylesheets inside the
head element. At the bottom of the
script tags with just a single one.