Hi
Does anyone know how to set default values for the site config fields ... similar to:
static $defaults = array (...);
for DataObjects?
I tried using static $defaults in my SiteConfig extension but the values didn't get set.
class CustomSiteConfig extends DataObjectDecorator {
/**
* Defines the additional site configuration fields
*
* @return array
*/
function extraStatics() {
return array(
'db' => array(
'IsDisplayTestAskUs' => 'Boolean'
, 'IsDisplayFooterHoncode' => 'Boolean'
),
}
/**
* Displays the edit fields in the CMS
*
* @param FieldSet $fields
*/
public function updateCMSFields( $fields ) {
$fields->addFieldToTab( 'Root.Main', new CheckboxField( 'IsDisplayTestAskUs', 'Display Test Ask Us') );
$fields->addFieldToTab( 'Root.Main', new CheckboxField( 'IsDisplayFooterHoncode', 'Display Footer HON code') );
}
// not sure if this will work with SiteConfig fields
static $defaults = array (
'IsDisplayTestAskUs' => true
, 'IsDisplayFooterHoncode' => true
);
}
Thanks!