You are here

public function DataExport::defineOptions in Views data export 8

Same name in this branch
  1. 8 src/Plugin/views/display/DataExport.php \Drupal\views_data_export\Plugin\views\display\DataExport::defineOptions()
  2. 8 src/Plugin/views/style/DataExport.php \Drupal\views_data_export\Plugin\views\style\DataExport::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 Serializer::defineOptions

File

src/Plugin/views/style/DataExport.php, line 37

Class

DataExport
A style plugin for data export views.

Namespace

Drupal\views_data_export\Plugin\views\style

Code

public function defineOptions() {
  $options = parent::defineOptions();

  // CSV options.
  // @todo Can these somehow be moved to a plugin?
  $options['csv_settings']['contains'] = [
    'delimiter' => [
      'default' => ',',
    ],
    'enclosure' => [
      'default' => '"',
    ],
    'escape_char' => [
      'default' => '\\',
    ],
    'strip_tags' => [
      'default' => TRUE,
    ],
    'trim' => [
      'default' => TRUE,
    ],
    'encoding' => [
      'default' => 'utf8',
    ],
    'utf8_bom' => [
      'default' => FALSE,
    ],
    'use_serializer_encode_only' => [
      'default' => FALSE,
    ],
  ];
  return $options;
}