PHP code example of nswdpc / silverstripe-field-hint

1. Go to this page and download the library: Download nswdpc/silverstripe-field-hint 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/ */

    

nswdpc / silverstripe-field-hint example snippets



/**
 * Add a hint that the action is a 'secondary' button/input
 */
\SilverStripe\Forms\FormAction::create(
    'doSecondary',
    _t('some.i18n_key', 'Complete secondary action')
)->setHint('secondary');

/**
 * Add a hint, and also add any class mapped to the 'secondary' hint in config
 * (See Sample project configuration, below)
 */
\SilverStripe\Forms\FormAction::create(
    'doSecondary',
    _t('some.i18n_key', 'Complete secondary action')
)->setHint('secondary', true);


\SilverStripe\Forms\FormAction::create(
    'doSecondary',
    _t('some.i18n_key', 'Complete secondary action')
)->setHint('secondary', true)
->setFieldHintIcon('delete');


\SilverStripe\Forms\FormAction::create(
    'doDangerousAction',
    _t('some.i18n_key', 'Complete dangerous action')
)->setHint('danger', true);