Created
November 30, 2015 18:01
-
-
Save DevJMD/75fe8bd128612ffd6b18 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ContactPage extends Page { | |
private static $db = array( | |
'Email' => 'Varchar(250)', | |
'AddressLine1' => 'Varchar(64)', | |
'AddressLine2' => 'Varchar(64)', | |
'AddressLine3' => 'Varchar(64)', | |
'AddressCity' => 'Varchar(64)', | |
'AddressPostCode' => 'Varchar(10)', | |
'MapsLatitude' => 'Double', | |
'MapsLongitude' => 'Double' | |
); | |
public function getCMSFields() { | |
$fields = parent::getCMSFields(); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('Email', 'Email'), 'Content'); | |
$fields->addFieldToTab('Root.Main', new HeaderField('Address Details'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('AddressLine1', 'Address Line 1'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('AddressLine2', 'Address Line 2'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('AddressLine3', 'Address Line 3'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('AddressCity', 'City/Town'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('AddressPostCode', 'Postal Code'), 'Content'); | |
$fields->addFieldToTab('Root.Main', new HeaderField('Map Location'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('MapsLatitude', 'Longitude'), 'Content'); | |
$fields->addFieldToTab('Root.Main', $this->scaffoldField('MapsLongitude', 'Longitude'), 'Content'); | |
return $fields; | |
} | |
} | |
class ContactPage_Controller extends Page_Controller { | |
public function Committees() { | |
return Committee::get(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment