yiisoft/yii-bootstrap5

Yii 框架 Twitter Bootstrap 5 扩展

dev-master / 3.0.x-dev 2024-07-12 17:56 UTC

This package is auto-updated.

Last update: 2024-09-12 18:19:55 UTC


README

Yii Bootstrap

Yii 框架 Twitter Bootstrap 5 扩展


Latest Stable Version Total Downloads Build status Code coverage Mutation testing badge static analysis type-coverage

Yii 框架 扩展将 Twitter Bootstrap 5 组件和插件封装为 Yii 小部件,因此使得在 Yii 应用程序中使用 Bootstrap 组件/插件变得极其简单。

要求

  • PHP 8.1 或更高版本。

安装

可以使用 Composer 安装此包。

composer require yiisoft/yii-bootstrap5

安装资源

安装资源有几种方式,它们是

  1. 使用 AssetPackagist 包管理器。

将以下内容添加到 composer.json 中

{
    "require": {
        "npm-asset/bootstrap": "^5.3",
        "oomphinc/composer-installers-extender": "^2.0"
    },
    "extra": {
        "installer-types": [
            "npm-asset"
        ],
        "installer-paths": {
            "./node_modules/{$name}": [
                "type:npm-asset"
            ]
        }
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        }
    ]
}

一旦做出更改,您可以使用以下命令安装资源

composer update
  1. 使用 npm-asset 包管理器。

在您应用程序的根目录中运行以下命令。

npm i bootstrap@5.3.1

通用用法

例如,以下视图文件中的一行代码将渲染一个 Bootstrap 进度插件

<?= Yiisoft\Yii\Bootstrap5\Progress::widget()
    ->percent('60')
    ->label('test') ?>

文档

如果您需要帮助或有问题,Yii 论坛 是一个不错的选择。您还可以查看其他 Yii 社区资源

许可

Yii 框架 Twitter Bootstrap 5 扩展是免费软件。它根据 BSD 许可证的条款发布。有关更多信息,请参阅 LICENSE

Yii 软件 维护。

支持项目

Open Collective

关注更新

Official website Twitter Telegram Facebook Slack