function FieldPluginBase::defineOptions
Same name in other branches
- 9 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions()
- 8.9.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions()
- 11.x core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions()
Overrides HandlerBase::defineOptions
26 calls to FieldPluginBase::defineOptions()
- Boolean::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ Boolean.php - Information about options for all kinds of purposes will be held here.
- BulkForm::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ BulkForm.php - Information about options for all kinds of purposes will be held here.
- ContextualLinks::defineOptions in core/
modules/ contextual/ src/ Plugin/ views/ field/ ContextualLinks.php - Information about options for all kinds of purposes will be held here.
- Counter::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ Counter.php - Information about options for all kinds of purposes will be held here.
- Custom::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ Custom.php - Information about options for all kinds of purposes will be held here.
26 methods override FieldPluginBase::defineOptions()
- Boolean::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ Boolean.php - Information about options for all kinds of purposes will be held here.
- BulkForm::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ BulkForm.php - Information about options for all kinds of purposes will be held here.
- ContextualLinks::defineOptions in core/
modules/ contextual/ src/ Plugin/ views/ field/ ContextualLinks.php - Information about options for all kinds of purposes will be held here.
- Counter::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ Counter.php - Information about options for all kinds of purposes will be held here.
- Custom::defineOptions in core/
modules/ views/ src/ Plugin/ views/ field/ Custom.php - Information about options for all kinds of purposes will be held here.
File
-
core/
modules/ views/ src/ Plugin/ views/ field/ FieldPluginBase.php, line 477
Class
- FieldPluginBase
- Base class for views fields.
Namespace
Drupal\views\Plugin\views\fieldCode
protected function defineOptions() {
$options = parent::defineOptions();
$options['label'] = [
'default' => '',
];
// Some styles (for example table) should have labels enabled by default.
$style = $this->view
->getStyle();
if (isset($style) && $style->defaultFieldLabels()) {
$options['label']['default'] = $this->definition['title'];
}
$options['exclude'] = [
'default' => FALSE,
];
$options['alter'] = [
'contains' => [
'alter_text' => [
'default' => FALSE,
],
'text' => [
'default' => '',
],
'make_link' => [
'default' => FALSE,
],
'path' => [
'default' => '',
],
'absolute' => [
'default' => FALSE,
],
'external' => [
'default' => FALSE,
],
'replace_spaces' => [
'default' => FALSE,
],
'path_case' => [
'default' => 'none',
],
'trim_whitespace' => [
'default' => FALSE,
],
'alt' => [
'default' => '',
],
'rel' => [
'default' => '',
],
'link_class' => [
'default' => '',
],
'prefix' => [
'default' => '',
],
'suffix' => [
'default' => '',
],
'target' => [
'default' => '',
],
'nl2br' => [
'default' => FALSE,
],
'max_length' => [
'default' => 0,
],
'word_boundary' => [
'default' => TRUE,
],
'ellipsis' => [
'default' => TRUE,
],
'more_link' => [
'default' => FALSE,
],
'more_link_text' => [
'default' => '',
],
'more_link_path' => [
'default' => '',
],
'strip_tags' => [
'default' => FALSE,
],
'trim' => [
'default' => FALSE,
],
'preserve_tags' => [
'default' => '',
],
'html' => [
'default' => FALSE,
],
],
];
$options['element_type'] = [
'default' => '',
];
$options['element_class'] = [
'default' => '',
];
$options['element_label_type'] = [
'default' => '',
];
$options['element_label_class'] = [
'default' => '',
];
$options['element_label_colon'] = [
'default' => TRUE,
];
$options['element_wrapper_type'] = [
'default' => '',
];
$options['element_wrapper_class'] = [
'default' => '',
];
$options['element_default_classes'] = [
'default' => TRUE,
];
$options['empty'] = [
'default' => '',
];
$options['hide_empty'] = [
'default' => FALSE,
];
$options['empty_zero'] = [
'default' => FALSE,
];
$options['hide_alter_empty'] = [
'default' => TRUE,
];
return $options;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.