2021-07-09 17:53:24 +08:00
|
|
|
Basic Usage
|
|
|
|
===========
|
|
|
|
|
2022-05-06 02:24:37 +08:00
|
|
|
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](https://getbootstrap.com/docs/). 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):
|
2021-07-09 17:53:24 +08:00
|
|
|
|
|
|
|
```php
|
|
|
|
public $depends = [
|
2022-05-06 02:24:37 +08:00
|
|
|
<...>
|
|
|
|
yii\bootstrap5\BootstrapAsset::class,
|
|
|
|
// optional, Bootstrap icons
|
|
|
|
// yii\bootstrap5\BootstrapIconAsset::class
|
2021-07-09 17:53:24 +08:00
|
|
|
];
|
|
|
|
```
|
|
|
|
|
2022-05-06 02:24:37 +08:00
|
|
|
Using Bootstrap through Yii asset manager allows you to minimize its resources and combine with your own resources when
|
2021-07-09 17:53:24 +08:00
|
|
|
needed.
|