Giter Site home page Giter Site logo

tags's Introduction

Tags Plugin for CakePHP

Version 1.2 for cake 2.x

The tags plugin includes the Taggable Behavior that allows you to simply tag everything.

It saves all tags in a tags table and connects any kind of records to them through the tagged table.

To create tables you can use migrations plugin or schema shell. To create tables execute:

cake schema create --plugin Tags --name tags

You can specify alternate tables for both in the case you get A LOT records tagged.

Usage

To make something taggable you just need to do two things:

  • Attach the taggable behavior
  • Add a 'tags' field into your view for the model you just made taggable

The taggable behavior can be configured using the following parameters

  • separator - separator used to enter a lot of tags, comma by default
  • tagAlias - model alias for Tag model
  • tagClass - class name of the model storing the tags
  • taggedClass - class name of the HABTM association table between tags and models
  • field - the field name that contains the raw tags as string
  • foreignKey - foreignKey used in the HABTM association
  • associationForeignKey - associationForeignKey used in the HABTM association
  • automaticTagging - if set to true you don't need to use saveTags() manually
  • language - only tags in a certain language, string or array
  • taggedCounter - true to update the number of times a particular tag was used for a specific record

The Tagged model contains a method _findCloud which can be used like any other find $this->Model->find('cloud', $options);

The result contains a "weight" field which has a normalized size of the tag occurrence set. The min and max size can be set by passing 'minSize" and 'maxSize' to the query. This value can be used in the view to control the size of the tag font.

Tags can contain special tokens called "identifiers" to namespace tags or classify them into categories.

A valid tags string to be saved is "foo, bar, cakephp:special".

The token "cakephp" will end up as the identifier or category for the tag "special"

Requirements

  • PHP version: PHP 5.2+
  • CakePHP version: 1.3 Stable

Support

For support and feature request, please visit the Tags Plugin Support Site.

For more information about our Professional CakePHP Services please visit the Cake Development Corporation website.

Branch strategy

The master branch holds the STABLE latest version of the plugin. Develop branch is UNSTABLE and used to test new features before releasing them.

Previous maintenance versions are named after the CakePHP compatible version, for example, branch 1.3 is the maintenance version compatible with CakePHP 1.3. All versions are updated with security patches.

Contributing to this Plugin

Please feel free to contribute to the plugin with new issues, requests, unit tests and code fixes or new features. If you want to contribute some code, create a feature branch from develop, and send us your pull request. Unit tests for new features and issues detected are mandatory to keep quality high.

License

Copyright 2009-2012, Cake Development Corporation

Licensed under The MIT License
Redistributions of files must retain the above copyright notice.

Copyright

Copyright 2009-2011
Cake Development Corporation
1785 E. Sahara Avenue, Suite 490-423
Las Vegas, Nevada 89104
http://cakedc.com

tags's People

Contributors

lorenzo avatar ajibarra avatar predominant avatar real34 avatar renan avatar skie avatar phpnut avatar shama avatar neterslandreau avatar yeliparra avatar cdburgess avatar josegonzalez avatar tiutalk avatar asecondwill avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.