function views_handler_field_views_system_required_by::add_self_tokens in Views System 7.4
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].
Overrides views_handler_field::add_self_tokens
File
- views/
views_handler_field_views_system_required_by.inc, line 42 - Definition of views_handler_field_views_system_required_by.
Class
- views_handler_field_views_system_required_by
- Field handler to display all other items that depends on this item.
Code
function add_self_tokens(&$tokens, $item) {
if (!empty($item['name'])) {
$tokens['[' . $this->options['id'] . '-label' . ']'] = $item['label'];
$tokens['[' . $this->options['id'] . '-name' . ']'] = $item['name'];
}
}