thtmorais/yii2-dropdown

下拉按钮 - 为 Yii PHP 框架提供动态更改操作

安装次数: 3,628

依赖项: 0

建议者: 0

安全性: 0

星标: 4

关注者: 3

分支: 3

开放问题: 0

类型:yii2-extension

0.0.4 2022-09-14 16:06 UTC

This package is auto-updated.

Last update: 2024-09-14 20:40:49 UTC


README

下拉按钮 - 为 Yii PHP 框架提供动态更改操作

安装

安装此扩展的首选方式是通过 composer

运行以下命令之一:

composer require thtmorais/yii2-dropdown "*"

或者在你的 composer.json 文件的 require 部分添加

"thtmorais/yii2-dropdown": "*"

使用方法

扩展安装完成后,只需在你的代码中使用它即可

<?= Dropdown::widget([
    'dropdownToggleClass' => 'btn btn-lg btn-success',
    'main' => [
        'id' => 'getStartedWithYii',
        'href' => 'https://yiiframework.cn/',
        'class' => 'btn btn-lg btn-success',
        'text' => 'Get started with Yii'
    ],
    'subordinate' => [
        [
            'id' => 'yiiDocumentation',
            'href' => 'https://yiiframework.cn/doc/',
            'text' => 'Yii Documentation'
        ],
        [
            'id' => 'yiiForum',
            'href' => 'https://yiiframework.cn/forum/',
            'text' => 'Yii Forum'
        ],
        [
            'id' => 'yiiExtensions',
            'href' => 'https://yiiframework.cn/extensions/',
            'text' => 'Yii Extensions'
        ]
    ],
    'options' => [
        'id' => 'group-dropdown',
        'class' => 'p-1'
    ]
]) ?>

正在执行的示例

dropdown