ContextualViewsHooks.php

Same filename and directory in other branches
  1. 11.x core/modules/contextual/src/Hook/ContextualViewsHooks.php

Namespace

Drupal\contextual\Hook

File

core/modules/contextual/src/Hook/ContextualViewsHooks.php

View source
<?php

namespace Drupal\contextual\Hook;

use Drupal\Core\Hook\Attribute\Hook;
use Drupal\Core\StringTranslation\StringTranslationTrait;

/**
 * Hook implementations for contextual.
 */
class ContextualViewsHooks {
  use StringTranslationTrait;
  
  /**
   * Implements hook_views_data_alter().
   */
  public function viewsDataAlter(&$data) : void {
    $data['views']['contextual_links'] = [
      'title' => $this->t('Contextual Links'),
      'help' => $this->t('Display fields in a contextual links menu.'),
      'field' => [
        'id' => 'contextual_links',
      ],
    ];
  }

}

Classes

Title Deprecated Summary
ContextualViewsHooks Hook implementations for contextual.

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