Bootstrap5 1.0.0
2025-04-13
19次浏览
yiisoft/bootstrap5 包的首个稳定版本已发布。该包将 Bootstrap 5 UI 框架封装为 Yii 小部件,便于在 PHP 模板中使用,并支持主题定制等功能。
<?php
use Yiisoft\Bootstrap5\Carousel;
use Yiisoft\Bootstrap5\CarouselItem;
use Yiisoft\Html\Tag\Div;
use Yiisoft\Html\Tag\H2;
use Yiisoft\Html\Tag\P;
?>
<?= Carousel::widget()
->id('carouselExampleOnlyText')
->items(
CarouselItem::to(
Div::tag()
->addClass('bg-primary text-white p-5 text-center')
->addContent(
H2::tag()->content('Title 1'),
P::tag()->content('This is the first slide with text.'),
),
),
CarouselItem::to(
Div::tag()
->addClass('bg-success text-white p-5 text-center')
->addContent(
H2::tag()->content('Title 2'),
P::tag()->content('This is the second slide with text.'),
),
),
CarouselItem::to(
Div::tag()
->addClass('bg-danger text-white p-5 text-center')
->addContent(
H2::tag()->content('Title 3'),
P::tag()->content('This is the third slide with text.'),
),
),
);
更多使用示例可查阅该包的用户指南。
新闻归档
热门标签
- yii3
- 扩展
- 发布
- yii2
- debug
- view
- auth client
- html
- bootstrap
- release
- apidoc
- Yii 1.1
- redis
- Yii 2.0
- mongodb
- extensions
- mailer
- runner
- gii
- console
- http 客户端
- queue
- validation
- twig
- hydrator
- http
- translator
- cache
- widget
- error handler
- sphinx
- config
- symfonymailer
- assets
- log
- router
- db
- imagine
- swagger
- elasticsearch
- 图书
- swiftmailer
- csrf
- IDE
- user
- definitions
- i18n
- widgets
- rbac
- fastroute