Skip to content

Instantly share code, notes, and snippets.

@muskie9
Created November 8, 2016 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muskie9/7d4e9190382720ecd3a32ee7e64c37a4 to your computer and use it in GitHub Desktop.
Save muskie9/7d4e9190382720ecd3a32ee7e64c37a4 to your computer and use it in GitHub Desktop.
<?php
/**
* Class CalendarSiteConfigExtension
*/
class CalendarSiteConfigExtension extends DataExtension
{
/**
* @var array
*/
private static $db = array(
'EventInstancesToShow' => 'Int',
);
/**
* @param FieldList $fields
*/
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab('Root', new TabSet('Calendar', 'Calendar'));
$fields->addFieldToTab(
'Root.Calendar.Settings',
NumericField::create('EventInstancesToShow')
->setTitle('Event Instances To Show')
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment