Skip to content

Instantly share code, notes, and snippets.

@hectorlorenzo
Created March 24, 2016 02:47
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 hectorlorenzo/68d2ff8b013ff73a1380 to your computer and use it in GitHub Desktop.
Save hectorlorenzo/68d2ff8b013ff73a1380 to your computer and use it in GitHub Desktop.
SilverStripe blank Strip object
<?php
class ExampleStrip extends Strip
{
//-------------------------------------------- DB model
/**
* @var array
*/
private static $db = [
'Key' => 'Value'
];
//-------------------------------------------- Relationships
/**
* @var array
*/
private static $has_one = [
'Item' => 'Item'
];
/**
* @var array
*/
private static $has_many = [
'Items' => 'Item'
];
/**
* @var array
*/
private static $many_many = [
'Items' => 'Items'
];
//-------------------------------------------- CMS Fields
/**
* @return mixed
*/
public function getCMSFields()
{
$fields = parent::getCMSFields();
//---------------------- Main Tab
$fields->addFieldsToTab('Root.Main',
[
]
);
return $fields;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment