You are here

protected function FieldPluginBase::defineOptions in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/field/FieldPluginBase.php \Drupal\views\Plugin\views\field\FieldPluginBase::defineOptions()

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

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/system/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.

... See full list

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/system/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.

... See full list

File

core/modules/views/src/Plugin/views/field/FieldPluginBase.php, line 419
Contains \Drupal\views\Plugin\views\field\FieldPluginBase.

Class

FieldPluginBase
Base class for views fields.

Namespace

Drupal\views\Plugin\views\field

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['label'] = array(
    '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'] = array(
    'default' => FALSE,
  );
  $options['alter'] = array(
    'contains' => array(
      'alter_text' => array(
        'default' => FALSE,
      ),
      'text' => array(
        'default' => '',
      ),
      'make_link' => array(
        'default' => FALSE,
      ),
      'path' => array(
        'default' => '',
      ),
      'absolute' => array(
        'default' => FALSE,
      ),
      'external' => array(
        'default' => FALSE,
      ),
      'replace_spaces' => array(
        'default' => FALSE,
      ),
      'path_case' => array(
        'default' => 'none',
      ),
      'trim_whitespace' => array(
        'default' => FALSE,
      ),
      'alt' => array(
        'default' => '',
      ),
      'rel' => array(
        'default' => '',
      ),
      'link_class' => array(
        'default' => '',
      ),
      'prefix' => array(
        'default' => '',
      ),
      'suffix' => array(
        'default' => '',
      ),
      'target' => array(
        'default' => '',
      ),
      'nl2br' => array(
        'default' => FALSE,
      ),
      'max_length' => array(
        'default' => 0,
      ),
      'word_boundary' => array(
        'default' => TRUE,
      ),
      'ellipsis' => array(
        'default' => TRUE,
      ),
      'more_link' => array(
        'default' => FALSE,
      ),
      'more_link_text' => array(
        'default' => '',
      ),
      'more_link_path' => array(
        'default' => '',
      ),
      'strip_tags' => array(
        'default' => FALSE,
      ),
      'trim' => array(
        'default' => FALSE,
      ),
      'preserve_tags' => array(
        'default' => '',
      ),
      'html' => array(
        'default' => FALSE,
      ),
    ),
  );
  $options['element_type'] = array(
    'default' => '',
  );
  $options['element_class'] = array(
    'default' => '',
  );
  $options['element_label_type'] = array(
    'default' => '',
  );
  $options['element_label_class'] = array(
    'default' => '',
  );
  $options['element_label_colon'] = array(
    'default' => TRUE,
  );
  $options['element_wrapper_type'] = array(
    'default' => '',
  );
  $options['element_wrapper_class'] = array(
    'default' => '',
  );
  $options['element_default_classes'] = array(
    'default' => TRUE,
  );
  $options['empty'] = array(
    'default' => '',
  );
  $options['hide_empty'] = array(
    'default' => FALSE,
  );
  $options['empty_zero'] = array(
    'default' => FALSE,
  );
  $options['hide_alter_empty'] = array(
    'default' => TRUE,
  );
  return $options;
}