Skip to content

Instantly share code, notes, and snippets.

@ajshort
Created May 11, 2012 10:34
Show Gist options
  • Select an option

  • Save ajshort/2658876 to your computer and use it in GitHub Desktop.

Select an option

Save ajshort/2658876 to your computer and use it in GitHub Desktop.
<?php
// _config.php
Object::add_extension('SiteConfig', 'CustomSiteConfig');
// CustomSiteConfig.php
class CustomSiteConfig extends DataObjectDecorator {
public function extraStatics() {
return array('has_many' => array(
'Relationship' => 'ClassName'
));
}
public function updateCMSFields(FieldSet $fields) {
$field->addFieldToTab('Root.TabName', new ComplexTableField(
$this->owner, 'Relationship', 'ClassName'
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment