PHP code example of sunnysideup / slices
1. Go to this page and download the library: Download sunnysideup/slices 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/ */
sunnysideup / slices example snippets
class ContentSlice extends Slice
{
protected function getBaseSliceClass()
{
return __CLASS__;
}
}
class VideoSlice extends ContentSlice
{
// Subclasses of your 'base' subclass don't need anything special
}
// Re-apply slices config
$config = $this->getCurrentTemplateConfig();
$this->configureFieldsFromConfig($fields, $config);