public function FilterTwig::tips in Twig Input Filter 8
Same name and namespace in other branches
- 2.x src/Plugin/Filter/FilterTwig.php \Drupal\twig\Plugin\Filter\FilterTwig::tips()
- 2.0.x src/Plugin/Filter/FilterTwig.php \Drupal\twig\Plugin\Filter\FilterTwig::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 FilterBase::tips
File
- src/
Plugin/ Filter/ FilterTwig.php, line 39 - Contains \Drupal\twig\Plugin\Filter\FilterTwig.
Class
- FilterTwig
- Provides a filter that allows text to be rendered using the Twig engine.
Namespace
Drupal\twig\Plugin\FilterCode
public function tips($long = FALSE, $context = []) {
return $this
->t('Use the Twig templating engine to render the text. See <a href=":url">@url</a> for more information.', [
':url' => 'http://twig.sensiolabs.org/documentation',
'@url' => 'http://twig.sensiolabs.org/documentation',
]);
}