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( 'Tags', 'Tags', Tag::get()->toArray("ID", "Name"), $this->Tags()->toArray("ID", "Name"), null, true );
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.