trait AdminLabelTrait in Views XML Backend 8
Helps views plugins display a useful admin label.
Hierarchy
- trait \Drupal\views_xml_backend\AdminLabelTrait
8 files declare their use of AdminLabelTrait
- Date.php in src/
Plugin/ views/ filter/ Date.php - Contains \Drupal\views_xml_backend\Plugin\views\filter\Date.
- Date.php in src/
Plugin/ views/ argument/ Date.php - Contains \Drupal\views_xml_backend\Plugin\views\argument\Date.
- Date.php in src/
Plugin/ views/ field/ Date.php - Contains \Drupal\views_xml_backend\Plugin\views\field\Date.
- Numeric.php in src/
Plugin/ views/ filter/ Numeric.php - Contains \Drupal\views_xml_backend\Plugin\views\filter\Numeric.
- Standard.php in src/
Plugin/ views/ filter/ Standard.php - Contains \Drupal\views_xml_backend\Plugin\views\filter\Standard.
File
- src/
AdminLabelTrait.php, line 13 - Contains \Drupal\views_xml_backendAdminLabelTrait.
Namespace
Drupal\views_xml_backendView source
trait AdminLabelTrait {
/**
* Returns a string representing this handler's name in the UI.
*
* @param bool $short
* Whether to return a short label.
*
* @return string
* The admin label.
*
* @see \Drupal\views\Plugin\views\ViewsHandlerInterface::adminLabel()
*/
public function adminLabel($short = FALSE) {
if (!empty($this->options['admin_label'])) {
return $this->options['admin_label'];
}
$title = $short && isset($this->definition['title short']) ? $this->definition['title short'] : $this->definition['title'];
return $this
->t('@xpath: @title', [
'@xpath' => $this->options['xpath_selector'],
'@title' => $title,
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AdminLabelTrait:: |
public | function | Returns a string representing this handler's name in the UI. |