Last active
December 19, 2015 06:48
-
-
Save trentsnippets/5913615 to your computer and use it in GitHub Desktop.
Add an upload field to silverstripe
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
//Add a single upload field to upload one image. | |
static $has_one = array( | |
'BackgroundImage' => 'Image' | |
); | |
$fields->addFieldToTab('Root.Main', new UploadField('BackgroundImage', 'Background Image'), 'Content'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment