Logarithmic Tag Cloud for Yii Framework ¶
Install: ¶
- Create table
tags
[sql] CREATE TABLE `tags` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `name` varchar(255) DEFAULT NULL, `frequency` int(11) DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
- Move files to folder /protected
Usage: ¶
<?php $this->widget('TagCloud', array('limit' => 50)); ?>
On GitHub https://github.com/Troytft/yii-tagcloud
some tips
about the tag font , you can refer to this : calculate the tag weight and the logarithms formula : in search of the perfect tag cloud;
@Troy :
i read your code , i found you use two sql to retrieve the max and min value from db . may be one sql query is better , see SQL Functions using MIN and MAX together
new version
@yiqing95 : Thanks, I uploaded new version.
Extends is not correct?
Good extension.
https://github.com/Troytft/yii-tagcloud/blob/master/models/Tag.php#L6
class Tag extends ActiveRecord
Maybe extends CActiveRecord?
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.