function ViewsUiHooks::help

Implements hook_help().

Attributes

#[Hook('help')]

File

core/modules/views_ui/src/Hook/ViewsUiHooks.php, line 25

Class

ViewsUiHooks
Hook implementations for views_ui.

Namespace

Drupal\views_ui\Hook

Code

public function help($route_name, RouteMatchInterface $route_match) : ?string {
  switch ($route_name) {
    case 'help.page.views_ui':
      $output = '';
      $output .= '<h2>' . $this->t('About') . '</h2>';
      $output .= '<p>' . $this->t('The Views UI module provides an interface for managing views for the <a href=":views">Views module</a>. For more information, see the <a href=":handbook">online documentation for the Views UI module</a>.', [
        ':views' => Url::fromRoute('help.page', [
          'name' => 'views',
        ])->toString(),
        ':handbook' => 'https://www.drupal.org/documentation/modules/views_ui',
      ]) . '</p>';
      $output .= '<h2>' . $this->t('Uses') . '</h2>';
      $output .= '<dl>';
      $output .= '<dt>' . $this->t('Creating and managing views') . '</dt>';
      $output .= '<dd>' . $this->t('Views can be created from the <a href=":list">Views list page</a> by using the "Add view" action. Existing views can be managed from the <a href=":list">Views list page</a> by locating the view in the "Enabled" or "Disabled" list and selecting the desired operation action, for example "Edit".', [
        ':list' => Url::fromRoute('entity.view.collection', [
          'name' => 'views_ui',
        ])->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . $this->t('Enabling and disabling views') . '<dt>';
      $output .= '<dd>' . $this->t('Views can be enabled or disabled from the <a href=":list">Views list page</a>. To enable a view, find the view within the "Disabled" list and select the "Enable" operation. To disable a view find the view within the "Enabled" list and select the "Disable" operation.', [
        ':list' => Url::fromRoute('entity.view.collection', [
          'name' => 'views_ui',
        ])->toString(),
      ]) . '</dd>';
      $output .= '<dt>' . $this->t('Exporting and importing views') . '</dt>';
      $output .= '<dd>' . $this->t('Views can be exported and imported as configuration files by using the <a href=":config">Configuration Manager module</a>.', [
        ':config' => \Drupal::moduleHandler()->moduleExists('config') ? Url::fromRoute('help.page', [
          'name' => 'config',
        ])->toString() : '#',
      ]) . '</dd>';
      $output .= '</dl>';
      return $output;
  }
  return NULL;
}

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