function ViewsUiThemeHooks::viewPreviewSectionDisplayCategoryLinks

Returns a link to editing a certain display setting.

1 call to ViewsUiThemeHooks::viewPreviewSectionDisplayCategoryLinks()
ViewsUiThemeHooks::preprocessViewPreviewSection in core/modules/views_ui/src/Hook/ViewsUiThemeHooks.php
Prepares variables for views UI view preview section templates.

File

core/modules/views_ui/src/Hook/ViewsUiThemeHooks.php, line 761

Class

ViewsUiThemeHooks
Hook implementations for views_ui.

Namespace

Drupal\views_ui\Hook

Code

protected function viewPreviewSectionDisplayCategoryLinks(ViewExecutable $view, $type, $title) : array {
  $display = $view->display_handler->display;
  $links = [
    $type . '-edit' => [
      'title' => $this->t('Edit @section', [
        '@section' => $title,
      ]),
      'url' => Url::fromRoute('views_ui.form_display', [
        'js' => 'nojs',
        'view' => $view->storage
          ->id(),
        'display_id' => $display['id'],
        'type' => $type,
      ]),
      'attributes' => [
        'class' => [
          'views-ajax-link',
        ],
      ],
    ],
  ];
  return $links;
}

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