【发布时间】:2014-06-03 16:15:33
【问题描述】:
我使用来自以下链接的 yii 标签云扩展 http://www.yiiframework.com/extension/yiitagcloud/
$this->widget('application.extensions.YiiTagCloud.YiiTagCloud',
array(
'beginColor' => '00089A',
'endColor' => 'A3AEFF',
'minFontSize' => 8,
'maxFontSize' => 20,
'arrTags' =>
array (
'MVC' => array('weight'=> 2),
'PHP' => array('weight'=> 9, 'url' => 'http://php.net'),
'MySQL' => array('weight'=> 8, 'url' => 'http://mysql.com'),
'jQuery' => array('weight'=> 6, 'url' => 'http://jquery.com'),
'SQL' => array('weight'=> 9),
'C#' => array('weight'=> 2),
),
)
);
它适用于手动或静态值,但我想在这里使用数组。数组结构是这样的
Array (
[toy] => 2
[not-possible ] => 1
[peace] => 1
[nedds] => 1
[fullfilment] => 1
[pakistan] => 1
[no-terrorism] => 1
[message-for-muslims] => 1
[a] => 1
[just ] => 1
[for-showoff] => 1
[a-dream] => 1
[peace-hen] => 1
[reality] => 1
)
其中key是标签,value是它的频率。现在请给我任何想法来使用这个小部件??
【问题讨论】:
标签: php arrays yii yii-extensions tag-cloud