Yii 1.1: tagcloud

Logarithmic Tag Cloud
12 followers

Logarithmic Tag Cloud for Yii Framework

Install:

  • Create table tags
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

Total 3 comments

#11556 report it
sirin at 2013/01/20 02:22pm
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?

#8936 report it
Troy at 2012/07/09 03:42am
new version

@yiqing95 : Thanks, I uploaded new version.

#8935 report it
yiqing95 at 2012/07/09 03:04am
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

Leave a comment

Please to leave your comment.

Create extension