PHP code example of purplespider / silverstripe-elemental-basic-gallery
1. Go to this page and download the library: Download purplespider/silverstripe-elemental-basic-gallery library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
purplespider / silverstripe-elemental-basic-gallery example snippets
namespace PurpleSpider\MySite;
use SilverStripe\Forms\FieldList;
use SilverStripe\Forms\TextField;
use SilverStripe\ORM\DataExtension;
use SilverStripe\Forms\CheckboxField;
class ImageGalleryBlockExtension extends DataExtension
{
private static $db = [
'DisplayAsSlideshow' => 'Boolean',
];
public function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab('Root.Main', CheckboxField::create('DisplayAsSlideshow', 'Display as Slideshow?'));
}
}