From 018193259134a54ebc07aaa4444adef635dfa19d Mon Sep 17 00:00:00 2001 From: Christopher Pitt Date: Tue, 28 Apr 2015 11:55:33 +1200 Subject: [PATCH] Add documentation + alias --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++-- composer.json | 5 +++++ 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ecfe0ba..3e12c2a 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,47 @@ -# silverstripe-tag-field +# TagField Module -Tag text field for SilverStripe. \ No newline at end of file +[![Build Status](https://secure.travis-ci.org/silverstripe-labs/silverstripe-tagfield.png?branch=master)](https://travis-ci.org/silverstripe-labs/silverstripe-tagfield) + +## Maintainer Contact + +* Christopher Pitt (Nickname: assertchris) + +## Requirements + +* SilverStripe 3.1 or newer +* Database: MySQL 5+, SQLite3, Postgres 8.3, SQL Server 2008 + +## Download/Information + +* http://silverstripe.org/tag-field-module + +## Usage + +```php +class BlogPost extends DataObject { + static $many_many = array( + 'BlogTags' => 'BlogTag' + ); +} +``` + +```php +class BlogTag extends DataObject { + static $db = array( + 'Title' => 'Varchar(200)', + ); + + static $belongs_many_many = array( + 'BlogPosts' => 'BlogPost' + ); +} +``` + +```php +$all = BlogTags::get()->map(); +$linked = $post->BlogTags()->map(); + +$field = new TagField( + 'BlogTags', 'Blog Tags', $all, $linked +); +``` \ No newline at end of file diff --git a/composer.json b/composer.json index b320d16..5fe3397 100644 --- a/composer.json +++ b/composer.json @@ -20,5 +20,10 @@ }, "require": { "silverstripe/framework": "~3.1" + }, + "extra": { + "branch-alias": { + "dev-develop": "2.0.x-dev" + } } }