mirror of
https://github.com/silverstripe/silverstripe-tagfield
synced 2024-10-22 11:05:32 +02:00
code | ||
css | ||
js | ||
templates | ||
tests/unit | ||
_config.php | ||
.gitignore | ||
.travis.yml | ||
composer.json | ||
README.md |
TagField Module
Maintainer Contact
- Christopher Pitt (Nickname: assertchris) <chris (at) silverstripe (dot) com>
Requirements
- SilverStripe 3.1 or newer
- Database: MySQL 5+, SQLite3, Postgres 8.3, SQL Server 2008
Download/Information
Usage
class BlogPost extends DataObject {
static $many_many = array(
'BlogTags' => 'BlogTag'
);
}
class BlogTag extends DataObject {
static $db = array(
'Title' => 'Varchar(200)',
);
static $belongs_many_many = array(
'BlogPosts' => 'BlogPost'
);
}
$all = BlogTags::get()->map();
$linked = $post->BlogTags()->map();
$field = new TagField(
'BlogTags', 'Blog Tags', $all, $linked
);