public function BootstrapButtonShortcode::tips in Bootstrap 3 shortcodes 8
Generates a filter's tip.
A filter's tips should be informative and to the point. Short tips are preferably one-liners.
@todo Split into getSummaryItem() and buildGuidelines().
Parameters
bool $long: Whether this callback should return a short tip to display in a form (FALSE), or whether a more elaborate filter tips should be returned for template_preprocess_filter_tips() (TRUE).
Return value
string|null Translated text to display as a tip, or NULL if this filter has no tip.
Overrides ShortcodeBase::tips
File
- src/
Plugin/ Shortcode/ BootstrapButtonShortcode.php, line 74 - Adds shortcodes for all Bootstrap elements.
Class
- BootstrapButtonShortcode
- @Shortcode( id = "bs_button", token = "button", title = @Translation("Button"), description = @Translation("Bootstrap 3 shortcode"), weight = 50 ) @author M. W. Delaney
Namespace
Drupal\bs_shortcodes\Plugin\ShortcodeCode
public function tips($long = FALSE) {
$output = array();
$output[] = '<p><strong>[button</strong> type="<u>default</u>, primary, success, info, warning, danger, link" size="xs, sm, lg" block="true, <u>false</u>" dropdown="true, <u>false</u>" active="true, <u>false</u>" disabled="true, <u>false</u>" link="any valid link" target="any valid target" xclass="any text" data="any text"<strong>]</strong> ... <strong>[/button]</strong>';
if ($long) {
$output[] = t('More info about this shortcode <a href=":url" target="_blank">here</a>', array(
':url' => 'https://github.com/MWDelaney/bootstrap-3-shortcodes#buttons',
)) . '.</p>';
}
else {
$output[] = t('More info <a href=":url" target="_blank">here</a>', array(
':url' => 'https://github.com/MWDelaney/bootstrap-3-shortcodes#buttons',
)) . '.</p>';
}
return implode(' ', $output);
}