1.4 KiB
1.4 KiB
Migrating from yii2-bootstrap4
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 ofyii\bootstrap4
- The php compatibility is limited to
>=7.0
- The close buttons of widgets like yii\bootstrap5\Alert or yii\bootstrap5 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.
Widgets / Classes
BaseHtml
ActiveField
ActiveForm
There is a new constant yii\bootstrap5\ActiveForm::LAYOUT_FLOATING. It's a new form layout introduced in Bootstrap 5.
Breadcrumbs
ButtonDropdown
ButtonToolbar
Carousel
LinkPager
Modal
Change data-target
and data-toggle
to data-bs-target
and data-bs-toggle
Nav
NavBar
There is now the possibility to create an offcanvas navbar.
You can achieve this by setting the $collapseOptions
to false
in yii\bootstrap5\NavBar widget and the
$offcanvasOptions
to at least an empty array.