Twitter Bootstrap Extension for Yii 2
This is the Twitter Bootstrap extension for Yii framework 2.0. It encapsulates Bootstrap 3 components and plugins in terms of Yii widgets, and thus makes using Bootstrap components/plugins in Yii applications extremely easy.
For license information check the LICENSE-file.
Documentation is at docs/guide/README.md.
Installation ¶
[!IMPORTANT]
- The minimum required PHP version is PHP
7.4.- It works best with PHP
8.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist yiisoft/yii2-bootstrap
or add
"yiisoft/yii2-bootstrap": "~2.0.0"
to the require section of your composer.json file.
Usage ¶
For example, the following single line of code in a view file would render a Bootstrap Progress plugin:
<?= yii\bootstrap\Progress::widget(['percent' => 60, 'label' => 'test']) ?>
Class Reference
| Class | Description |
|---|---|
| yii\ |
A Bootstrap 3 enhanced version of yii\ |
| yii\ |
A Bootstrap 3 enhanced version of yii\ |
| yii\ |
Alert renders an alert bootstrap component. |
| yii\ |
BaseHtml provides concrete implementation for yii\ |
| yii\ |
Asset bundle for the Twitter bootstrap css files. |
| yii\ |
Asset bundle for the Twitter bootstrap javascript files. |
| yii\ |
Asset bundle for the Twitter bootstrap default theme. |
| yii\ |
BootstrapWidgetTrait is the trait, which provides basic for all bootstrap widgets features. |
| yii\ |
Button renders a bootstrap button. |
| yii\ |
ButtonDropdown renders a group or split button dropdown bootstrap component. |
| yii\ |
ButtonGroup renders a button group bootstrap component. |
| yii\ |
Carousel renders a carousel bootstrap javascript component. |
| yii\ |
Collapse renders an accordion bootstrap javascript component. |
| yii\ |
Dropdown renders a Bootstrap dropdown menu component. |
| yii\ |
Html is an enhanced version of yii\ |
| yii\ |
InputWidget is an adjusted for bootstrap needs version of yii\ |
| yii\ |
Modal renders a modal window that can be toggled by clicking on a button. |
| yii\ |
Nav renders a nav HTML component. |
| yii\ |
NavBar renders a navbar HTML component. |
| yii\ |
Progress renders a bootstrap progress bar component. |
| yii\ |
Tabs renders a Tab bootstrap javascript component. |
| yii\ |
ToggleButtonGroup allows rendering form inputs Checkbox/Radio toggle button groups. |
| yii\ |
\yii\bootstrap\Widget is the base class for all bootstrap widgets. |

