watson/taggly 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

watson/taggly

Composer 安装命令:

composer require watson/taggly

包简介

A modern port of the old CodeIgniter Taggly library.

README 文档

README

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);

统计信息

  • 总下载量: 1.39k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 6
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-07-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固