PHP code example of clesson-de / silverstripe-hints
1. Go to this page and download the library: Download clesson-de/silverstripe-hints 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/ */
clesson-de / silverstripe-hints example snippets
use Clesson\Silverstripe\Hints\Constants\HintType;
use Clesson\Silverstripe\Hints\Forms\HintField;
// Expanded info hint (default)
$fields->addFieldToTab('Root.Main', HintField::create(
'MyHint',
'Important note',
'<p>Please read this carefully before saving.</p>'
));
// Collapsed warning hint
$fields->addFieldToTab('Root.Main', HintField::create(
'MyWarning',
'Warning',
'<p>This action cannot be undone.</p>'
)->setType(HintType::WARNING)->setCollapsed(true));