UnformattedSummary.php

Same filename and directory in other branches
  1. 9 core/modules/views/src/Plugin/views/style/UnformattedSummary.php
  2. 8.9.x core/modules/views/src/Plugin/views/style/UnformattedSummary.php
  3. 10 core/modules/views/src/Plugin/views/style/UnformattedSummary.php

Namespace

Drupal\views\Plugin\views\style

File

core/modules/views/src/Plugin/views/style/UnformattedSummary.php

View source
<?php

namespace Drupal\views\Plugin\views\style;

use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\views\Attribute\ViewsStyle;

/**
 * The default style plugin for summaries.
 *
 * @ingroup views_style_plugins
 */
class UnformattedSummary extends DefaultSummary {
    protected function defineOptions() {
        $options = parent::defineOptions();
        $options['inline'] = [
            'default' => FALSE,
        ];
        $options['separator'] = [
            'default' => '',
        ];
        return $options;
    }
    public function buildOptionsForm(&$form, FormStateInterface $form_state) {
        parent::buildOptionsForm($form, $form_state);
        $form['inline'] = [
            '#type' => 'checkbox',
            '#default_value' => !empty($this->options['inline']),
            '#title' => $this->t('Display items inline'),
        ];
        $form['separator'] = [
            '#type' => 'textfield',
            '#title' => $this->t('Separator'),
            '#default_value' => $this->options['separator'],
        ];
    }

}

Classes

Title Deprecated Summary
UnformattedSummary The default style plugin for summaries.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.