You are here

public function PathPluginBase::buildOptionsForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/views/src/Plugin/views/display/PathPluginBase.php \Drupal\views\Plugin\views\display\PathPluginBase::buildOptionsForm()

Provide a form to edit options for this plugin.

Overrides DisplayPluginBase::buildOptionsForm

2 calls to PathPluginBase::buildOptionsForm()
Feed::buildOptionsForm in core/modules/views/src/Plugin/views/display/Feed.php
Provide a form to edit options for this plugin.
Page::buildOptionsForm in core/modules/views/src/Plugin/views/display/Page.php
Provide a form to edit options for this plugin.
2 methods override PathPluginBase::buildOptionsForm()
Feed::buildOptionsForm in core/modules/views/src/Plugin/views/display/Feed.php
Provide a form to edit options for this plugin.
Page::buildOptionsForm in core/modules/views/src/Plugin/views/display/Page.php
Provide a form to edit options for this plugin.

File

core/modules/views/src/Plugin/views/display/PathPluginBase.php, line 394
Contains \Drupal\views\Plugin\views\display\PathPluginBase.

Class

PathPluginBase
The base display plugin for path/callbacks. This is used for pages and feeds.

Namespace

Drupal\views\Plugin\views\display

Code

public function buildOptionsForm(&$form, FormStateInterface $form_state) {
  parent::buildOptionsForm($form, $form_state);
  switch ($form_state
    ->get('section')) {
    case 'path':
      $form['#title'] .= $this
        ->t('The menu path or URL of this view');
      $form['path'] = array(
        '#type' => 'textfield',
        '#title' => $this
          ->t('Path'),
        '#description' => $this
          ->t('This view will be displayed by visiting this path on your site. You may use "%" in your URL to represent values that will be used for contextual filters: For example, "node/%/feed". If needed you can even specify named route parameters like taxonomy/term/%taxonomy_term'),
        '#default_value' => $this
          ->getOption('path'),
        '#field_prefix' => '<span dir="ltr">' . $this
          ->url('<none>', [], [
          'absolute' => TRUE,
        ]),
        '#field_suffix' => '</span>&lrm;',
        '#attributes' => array(
          'dir' => LanguageInterface::DIRECTION_LTR,
        ),
        // Account for the leading backslash.
        '#maxlength' => 254,
      );
      break;
  }
}