public static Views::getEnabledViews()
Returns an array of all enabled views.
Return value
\Drupal\views\Entity\View[] An array of loaded enabled view entities.
File
- core/modules/views/src/Views.php, line 254
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::entityManager()->getStorage('view')->loadMultiple($query); }
Please login to continue.