You are here

public function RandomShortcode::tips in Shortcode 8

Same name and namespace in other branches
  1. 2.0.x shortcode_basic_tags/src/Plugin/Shortcode/RandomShortcode.php \Drupal\shortcode_basic_tags\Plugin\Shortcode\RandomShortcode::tips()

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

shortcode_basic_tags/src/Plugin/Shortcode/RandomShortcode.php, line 46

Class

RandomShortcode
Insert div or span around the text with some css classes.

Namespace

Drupal\shortcode_basic_tags\Plugin\Shortcode

Code

public function tips($long = FALSE) {
  $output = [];
  $output[] = '<p><strong>[random (length="8") /]</strong>';
  $output[] = $this
    ->t('Inserts a random text with the given length.') . '</p>';
  return implode(' ', $output);
}