PHP code example of sminnee / silverstripe-verbosefields
1. Go to this page and download the library: Download sminnee/silverstripe-verbosefields 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/ */
sminnee / silverstripe-verbosefields example snippets
use Sminnee\VerboseFields\VerboseOptionsetField;
// ...
function getCMSFields() {
$fields = parent::getCMSFields();
$descriptions = [
'Apple' => '<b>Apple</b><p>A delicious fruit and also a hardware manufacturerer.<p><p><img src="..."></p>',
'Orange' => '<b>Orange</b><p>A fruit that is usually turned into juice, rendering something somewhat healthy into a healthy-seeming confection.</p>',
'Pear' => '<b>Pear</b><p>A ripe pear is an excellent choice for when your hands are too clean and need to be stickier.</p>',
];
$source = [
'Apple' => 'Apple',
'Orange' => 'Orange',
'Pear' => 'Pear',
];
$fields->addFieldToTab(
'Root.Tab',
(new VerboseOptionsetField('Fruit', 'Fruit'))
->setSource($source)
->setSourceDescriptions($descriptions);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.