yii2-bootstrap5/docs/guide/basic-usage.md
2022-05-05 21:24:37 +03:00

679 B

Basic Usage

Yii doesn't wrap the Bootstrap basics into PHP code since HTML is very simple by itself in this case. You can find details about using the basics at Bootstrap documentation. Still Yii provides a convenient way to include Bootstrap assets in your pages with a line(s) added to @app/assets/AppAsset.php(basic application):

public $depends = [
    <...>
    yii\bootstrap5\BootstrapAsset::class,
    // optional, Bootstrap icons
    // yii\bootstrap5\BootstrapIconAsset::class
];

Using Bootstrap through Yii asset manager allows you to minimize its resources and combine with your own resources when needed.