Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class DrawerLink extends DataObject {
- public static $db = array(
- 'Label' => 'Varchar(255)',
- // external URL
- 'URL' => 'Varchar(255)',
- // internal URL
- );
- public static $has_one = array(
- 'Drawer' => 'Drawer',
- 'I_URL' => 'SiteTree',
- );
- public function getCMSFields() {
- $fields = parent::getCMSFields();
- // change the label on the CMS UI
- $fields->renameField('Label', 'Drawer Header');
- $fields->renameField('URL', 'External URL');
- // need to change the label I_URL to Internal URL
- $fields->replaceField('I_URL', new TextField('I_URL', 'Internal URL'));
- // $iurl_field = $this->fieldByName('I_URL');
- // $iurl_field->setTitle('test');
- return $fields;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement