Merge pull request #33 from barry-bookinglive/master

This commit is contained in:
Daniel Hensby 2015-08-10 13:12:53 +01:00
commit 6ece085988
1 changed files with 9 additions and 7 deletions

View File

@ -37,12 +37,14 @@ class BlogTag extends DataObject {
``` ```
```php ```php
$field = new TagField( $field = TagField::create(
'BlogTags', 'Blog Tags', BlogTag::get(), $post->BlogTags() 'BlogTags',
); 'Blog Tags',
BlogTag::get(),
$field->setShouldLazyLoad(true); // tags should be lazy loaded $post->BlogTags()
$field->setCanCreate(true); // new tag DataObjects can be created )
->setShouldLazyLoad(true) // tags should be lazy loaded
->setCanCreate(true); // new tag DataObjects can be created
``` ```
### String Tags ### String Tags
@ -56,7 +58,7 @@ class BlogPost extends DataObject {
``` ```
```php ```php
$field = new StringTagField( $field = StringTagField::create(
'BlogTags', 'Blog Tags', array('one', 'two'), explode(',', $post->Tags) 'BlogTags', 'Blog Tags', array('one', 'two'), explode(',', $post->Tags)
); );