Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
Fixed formatting in general
Refactored protected methods and removed underscore prefix
Added public variable to closure as an example
Fixed PHPDoc on methods and properties
  • Loading branch information
lotsofcode committed Aug 5, 2014
1 parent a1de2eb commit c2c769e
Show file tree
Hide file tree
Showing 3 changed files with 620 additions and 567 deletions.
12 changes: 10 additions & 2 deletions README.md
Expand Up @@ -44,15 +44,23 @@

#### Set a custom HTML output

$cloud->setHtmlizeTagFunction( function($tag, $size) {
$link = '<a href="'.$tag['url'].'">'.$tag['tag'].'</a>';
$cloud->setHtmlizeTagFunction(function($tag, $size) use ($baseUrl) {
$link = '<a href="'.$baseUrl.'/'.$tag['url'].'">'.$tag['tag'].'</a>';
return "<span class='tag size{$size} colour-{$tag['colour']}'>{$link}</span> ";
});

#### Outputting the cloud (shown above)

echo $cloud->render();

#### Transliteration

By default, all accented characters will be converted into their non-accented equivalent,
this is to circumvent duplicate similar tags in the same cloud, to disable this functionality
and display the UTF-8 characters you can do the following:

$tagCloud->setOption('transliterate', false);

More usages on in a prettier format can be found here: http://lotsofcode.github.com/tag-cloud

## Tests
Expand Down

0 comments on commit c2c769e

Please sign in to comment.