New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

watson/taggly

A modern port of the old CodeIgniter Taggly library.
1,400 6
Install
composer require watson/taggly
Latest Version:1.1.3
PHP:>=5.4.0
Laravel:4 · 5
License:MIT
Last Updated:Sep 7, 2017
Links: GitHub  ·  Packagist
Maintainer: dwightwatson

Taggly, a tag cloud generator

Taggly is a modern port of the old CodeIgniter Taggly library by Gavin Vickery. Packaged with a service provider and facade for Laravel, this package is totally framework agnostic and will help you to generate tag clouds just like the cool kids. Note, styling the cloud is up to you!

Installation

Simply add the package to your composer.json file and run composer update.

"watson/taggly": "1.0.*"

If you're using Laravel, be sure to register the service provider and facade if you would like to use those.

Under providers:

'Watson\Taggly\TagglyServiceProvider',

And under aliases:

'Tag' => 'Watson\Taggly\TagFacade',

Overview

First, let's look at what makes up a tag in Taggly. A tag is made up of 3 things:

  • the tag name
  • the number of times it occurs, or it's weight
  • the path it should link to (optional)

You can either use an associative array or a Watson\Taggly\Tag object to represent a single tag. Here is how you represent a tag as an associative array:

$tag = array('tag' => 'Laravel', 'count' => 4, 'url' => 'https://www.laravel.com');

Simply passing this array to a new Tag object to use an object instead.

$tag = new Watson\Taggly\Tag($tag);

Once you have a collection of tags, you can pass them to Taggly and generate a cloud.

$taggly = new Watson\Taggly\Taggly;
$taggly->setTags([$tag1, $tag2, ...]);

echo $taggly->cloud();

You can also just pass the tags to the cloud() method, which is great if you're using the facade too.

Tag::cloud($tags);

Related Packages

lancewan/laravel5-cloud

荣联云通讯接口 for laravel5

912 11
unisharp/laravel-taggable

Handle with independent tables or in on table

33 3
laravel/cloud-cli

CLI to interact with Laravel Cloud

91,045 52
yoelpc4/laravel-cloudinary

Laravel Cloudinary filesystem cloud driver.

48,911 33
onramplab/laravel-cloud-cost

query cloud cost information

6,408 0

Version History

Version Released PHP Laravel License
1.1.3 >=5.4.0 ~4.0 || ~5.0 MIT
1.1.2 >=5.4.0 ~4.0 || ~5.0 MIT
1.1.1 >=5.4.0 ~4.0 || ~5.0 MIT
1.1.0 >=5.4.0 ~4.0 || ~5.0 MIT
1.0.0 >=5.4.0 4.2.* MIT