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



use SilverStripe\Forms\FormAction;

//...


/**
 * Add a hint that the action is a 'secondary' button/input
 */
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)
 */
FormAction::create(
    'doSecondary',
    _t('some.i18n_key', 'Complete secondary action')
)->setHint('secondary', true);

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