<code>
class Test extends Page {
static $db = array(
);
static $has_one = array(
);
function getCMSFields() {
$fields = parent::getCMSFields();
$fields->addFieldsToTab(
'Root.Content.Main',
array(
new CheckboxSetField(
$name = "topics",
$title = "I am interested in the following topics",
$source = array(
"1" => "Technology",
"2" => "Gardening",
"3" => "Cooking",
"4" => "Sports"
),
$value = "1"
)
)
);
return $fields;
}
}
</code>
I realize this is a very basic question, but I am new to silverstripe and I am stumped.
How do I declare the variable "topics", as it stands, the checkboxes appear fine in the admin part, but I can't save them (they always revert back to the default value) nor display results.