Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Views.php

function Views::getEnabledViews

Returns an array of all enabled views.

Return value

\Drupal\views\Entity\View[] An array of loaded enabled view entities.

1 call to Views::getEnabledViews()
Views::pluginList in core/modules/views/src/Views.php
Returns a list of plugins and metadata about them.

File

core/modules/views/src/Views.php, line 258

Class

Views
Static service container wrapper for views.

Namespace

Drupal\views

Code

public static function getEnabledViews() {
    $query = \Drupal::entityQuery('view')->condition('status', TRUE)
        ->execute();
    return \Drupal::entityTypeManager()->getStorage('view')
        ->loadMultiple($query);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal