drtsb/yii2-tag-cloud

Yii2标签云

安装: 155

依赖: 0

建议者: 0

安全性: 0

星标: 0

关注者: 2

分支: 1

开放问题: 0

类型:yii2-extension

1.0.0 2020-09-13 17:53 UTC

This package is auto-updated.

Last update: 2024-09-19 11:44:54 UTC


README

Latest Stable Version Total Downloads

Yii2 扩展。标签云。

安装

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

要安装,请运行以下命令之一:

$ php composer.phar require drtsb/yii2-tag-cloud "*"

"drtsb/yii2-tag-cloud": "*"

将以下内容添加到您的 composer.json 文件的 require 部分:

使用方法

echo TagCloud::widget([
    'beginColor' => '00089A',
    'endColor' => 'A3AEFF',
    'minFontSize' => 8,
    'maxFontSize' => 15,
    'displayWeight' => false,
    'tags' => [
        "MVC" => ['weight' => 2],
        "PHP" => ['weight' => 9, 'url' => 'https://php.ac.cn'],
        "MySQL" => ['weight' => 8, 'url' => 'https://mysqlserver.cn'],
        "jQuery" => ['weight' => 6, 'url' => 'https://jqueryjs.cn'],
        "SQL" => ['weight' => 9],
        "C#" => ['weight' => 2)],
    ],
    'options' => ['style' => 'word-wrap: break-word;']
]);