You are here

class UIkitViews in UIkit Components 8

Same name and namespace in other branches
  1. 8.3 uikit_views/src/UIkitViews.php \Drupal\uikit_views\UIkitViews
  2. 8.2 uikit_views/src/UIkitViews.php \Drupal\uikit_views\UIkitViews

Class UIkitViews

@package Drupal\uikit_views

Hierarchy

Expanded class hierarchy of UIkitViews

2 files declare their use of UIkitViews
uikit_views.module in uikit_views/uikit_views.module
UIkit Views.
uikit_views.theme.inc in uikit_views/includes/uikit_views.theme.inc
Preprocessors and helper functions to make theming easier.

File

uikit_views/src/UIkitViews.php, line 13

Namespace

Drupal\uikit_views
View source
class UIkitViews {

  /**
   * Returns the theme hook definition information for UIkit Views.
   */
  public static function getThemeHooks() {
    $hooks['uikit_view_grid'] = [
      'preprocess functions' => [
        'template_preprocess_uikit_view_grid',
        'template_preprocess_views_view_grid',
      ],
      'file' => 'includes/uikit_views.theme.inc',
    ];
    $hooks['uikit_view_list'] = [
      'preprocess functions' => [
        'template_preprocess_uikit_view_list',
        'template_preprocess_views_view_list',
      ],
      'file' => 'includes/uikit_views.theme.inc',
    ];
    $hooks['uikit_view_table'] = [
      'preprocess functions' => [
        'template_preprocess_uikit_view_table',
        'template_preprocess_views_view_table',
      ],
      'file' => 'includes/uikit_views.theme.inc',
    ];
    return $hooks;
  }

  /**
   * Get unique element id.
   *
   * @param \Drupal\views\ViewExecutable $view
   *   A ViewExecutable object.
   *
   * @return string
   *   A unique id for an HTML element.
   */
  public static function getUniqueId(ViewExecutable $view) {
    $id = $view->storage
      ->id() . '-' . $view->current_display;
    return Html::getUniqueId('views-uikit-' . $id);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
UIkitViews::getThemeHooks public static function Returns the theme hook definition information for UIkit Views.
UIkitViews::getUniqueId public static function Get unique element id.