O'Reilly logo

Yii2 By Example by Fabrizio Caldarelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Bootstrap widget

Yii2 supports Bootstrap as a core feature. Bootstrap framework CSS and JavaScript files are injected by default in all pages and we could even use this feature to only apply CSS classes or call our own JavaScript function provided by Bootstrap.

However, Yii2 embeds Bootstrap as a widget, and we can access this framework's capabilities like any other widget.

The most used are:

Class name

Description

yii\bootstrap\Alert

This class renders an alert Bootstrap component

yii\bootstrap\Button

This class renders a Bootstrap button

yii\bootstrap\Dropdown

This class renders a Bootstrap drop-down menu component

yii\bootstrap\Nav

This class renders a nav HTML component

yii\bootstrap\NavBar

This class renders a ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required