function FieldPluginBase::addSelfTokens
Same name and namespace in other branches
- 11.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::addSelfTokens()
- 10 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::addSelfTokens()
- 8.9.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::addSelfTokens()
Add any special tokens this field might use for itself.
This method is intended to be overridden by items that generate fields as a list. For example, the field that displays all terms on a node might have tokens for the tid and the term.
By convention, tokens should follow the format of {{ token__subtoken }} where token is the field ID and subtoken is the field. If the field ID is terms, then the tokens might be {{ terms__tid }} and {{ terms__name }}.
File
-
core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php, line 1726
Class
- FieldPluginBase
- Base class for views fields.
Namespace
Drupal\views\Plugin\views\fieldCode
protected function addSelfTokens(&$tokens, $item) {
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.