Skip to content

Instantly share code, notes, and snippets.

@gordonbanderson
Created April 3, 2013 00:57
Show Gist options
  • Save gordonbanderson/5297609 to your computer and use it in GitHub Desktop.
Save gordonbanderson/5297609 to your computer and use it in GitHub Desktop.
<?php
class ContactPageAddress extends DataObject {
static $db = array(
'PostalAddress' => 'Text'
);
static $has_one = array( 'ContactPage' => 'ContactPage' );
public static $summary_fields = array(
'PostalAddress' => 'PostalAddress'
);
function getCMSFields() {
$fields = new FieldList();
$fields->push( new TabSet( "Root", $mainTab = new Tab( "Main" ) ) );
$mainTab->setTitle( _t( 'SiteTree.TABMAIN', "Main" ) );
$fields->addFieldToTab( "Root.Main", new TextField( 'PostalAddress' ) );
$this->extend( 'updateCMSFields', $fields );
return $fields;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment