2021-08-03 16:26:03 +08:00
|
|
|
Migrating from yii2-bootstrap4
|
|
|
|
==============================
|
2021-07-09 17:53:24 +08:00
|
|
|
|
|
|
|
yii2-bootstrap5 is a major rewrite of the entire project (according Bootstrap 5 to Bootstrap 4 migration guide).
|
|
|
|
The most notable changes are summarized below:
|
|
|
|
|
|
|
|
## General
|
|
|
|
|
|
|
|
* The namespace is `yii\bootstrap5` instead of `yii\bootstrap4`
|
2021-08-04 14:28:49 +08:00
|
|
|
* The php compatibility **is limited to** `>=7.0`
|
2021-08-18 21:41:26 +08:00
|
|
|
* The close buttons of widgets like [[yii\bootstrap5\Alert|Alert]] or [[yii\bootstrap5|Modal|Modal]] now gets rendered
|
|
|
|
via CSS and does not have any content anymore. So be sure to remove `btn-close` class and set appropriate styles yourself
|
|
|
|
if you override it.
|
2021-07-09 17:53:24 +08:00
|
|
|
|
|
|
|
## Widgets / Classes
|
|
|
|
|
|
|
|
### BaseHtml
|
|
|
|
|
|
|
|
### ActiveField
|
|
|
|
|
|
|
|
### ActiveForm
|
|
|
|
|
2021-08-03 16:41:30 +08:00
|
|
|
There is a new constant [[yii\bootstrap5\ActiveForm::LAYOUT_FLOATING]]. It's a
|
2021-08-05 15:21:05 +08:00
|
|
|
[new form layout](https://getbootstrap.com/docs/5.1/forms/floating-labels/) introduced in Bootstrap 5.
|
2021-08-03 16:41:30 +08:00
|
|
|
|
2021-07-09 17:53:24 +08:00
|
|
|
### Breadcrumbs
|
|
|
|
|
|
|
|
### ButtonDropdown
|
|
|
|
|
|
|
|
### ButtonToolbar
|
|
|
|
|
|
|
|
### Carousel
|
|
|
|
|
|
|
|
### LinkPager
|
|
|
|
|
|
|
|
### Modal
|
|
|
|
|
|
|
|
### Nav
|
|
|
|
|
|
|
|
### NavBar
|
|
|
|
|
2021-08-05 16:46:05 +08:00
|
|
|
There is now the possibility to create an [offcanvas navbar](https://getbootstrap.com/docs/5.1/components/navbar/#offcanvas).
|
|
|
|
You can achieve this by setting the `$collapseOptions` to `false` in [[yii\bootstrap5\NavBar|Navbar]] widget and the
|
|
|
|
`$offcanvasOptions` to at least an empty array.
|
|
|
|
|
2021-07-09 17:53:24 +08:00
|
|
|
### Tabs
|
|
|
|
|
|
|
|
### ToggleButtonGroup
|