You are here

protected function Grid::defineOptions in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/views/src/Plugin/views/style/Grid.php \Drupal\views\Plugin\views\style\Grid::defineOptions()
  2. 9 core/modules/views/src/Plugin/views/style/Grid.php \Drupal\views\Plugin\views\style\Grid::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 StylePluginBase::defineOptions

File

core/modules/views/src/Plugin/views/style/Grid.php, line 31

Class

Grid
Style plugin to render each item in a grid cell.

Namespace

Drupal\views\Plugin\views\style

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  $options['columns'] = [
    'default' => '4',
  ];
  $options['automatic_width'] = [
    'default' => TRUE,
  ];
  $options['alignment'] = [
    'default' => 'horizontal',
  ];
  $options['col_class_custom'] = [
    'default' => '',
  ];
  $options['col_class_default'] = [
    'default' => TRUE,
  ];
  $options['row_class_custom'] = [
    'default' => '',
  ];
  $options['row_class_default'] = [
    'default' => TRUE,
  ];
  return $options;
}