/** * Generate the tag array and echo the cloud * * @return array * */ public static function showCloud(array $tags, $url = '') { self::$url = $url; asort($tags); reset($tags); self::$smallest = current($tags); end($tags); self::$largest = current($tags); $diff = self::$largest - self::$smallest; self::$interval = round($diff / 3); self::$tags = $tags; reset(self::$tags); self::$cloud_tags = array(); foreach (self::$tags as $tag => $amount) { echo link_to($tag, str_replace("%25tag%25", urlencode($tag), self::$url), array('class' => self::getSize($amount))) . ' '; } }