Views::getView

public static Views::getView($id)

Loads a view from configuration and returns its executable object.

Parameters

string $id: The view ID to load.

Return value

\Drupal\views\ViewExecutable A view executable instance, from the loaded entity.

File

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

Class

Views
Static service container wrapper for views.

Namespace

Drupal\views

Code

public static function getView($id) {
  $view = \Drupal::service('entity.manager')->getStorage('view')->load($id);
  if ($view) {
    return static::executableFactory()->get($view);
  }
}
doc_Drupal
2016-10-29 09:54:49
Comments
Leave a Comment

Please login to continue.