Jump to:

3448 Posts in 1062 Topics by 738 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Listing dataobjects with ListboxField

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 365 Views
  • sweetroll
    Community Member
    1 Post

    Listing dataobjects with ListboxField Link to this post


    I have a many to many relationship between a DataObject (Tag) and a Page and am wanting to manage the relationship through a multiple select.

    At the moment I am stuck with the following code

    $tagsField = new ListboxField(
    Tag::get()->toArray("ID", "Name"),
    $this->Tags()->toArray("ID", "Name"),

    Error: Object->__call(): the method 'fortemplate' does not exist on 'Tag'

    I know this code won't currently allow me to add new tags but I would like to get my head around how to link existing tags with a page.

    Hopefully I am not too far off.


Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.