function Views::getView
Loads a view from configuration and returns its executable object.
Parameters
string $id: The view ID to load.
Return value
\Drupal\views\ViewExecutable|null A view executable instance or NULL if the view does not exist.
469 calls to Views::getView()
- AccessPermissionTest::testAccessPerm in core/
modules/ user/ tests/ src/ Kernel/ Views/ AccessPermissionTest.php  - Tests perm access plugin.
 - AccessPermissionTest::testRenderCaching in core/
modules/ user/ tests/ src/ Kernel/ Views/ AccessPermissionTest.php  - Tests access on render caching.
 - AccessRoleTest::testRenderCaching in core/
modules/ user/ tests/ src/ Functional/ Views/ AccessRoleTest.php  - Tests access on render caching.
 - AccessTest::testAccessNone in core/
modules/ views/ tests/ src/ Functional/ Plugin/ AccessTest.php  - Tests none access plugin.
 - AccessTest::testContentAccessFilter in core/
modules/ views/ tests/ src/ Functional/ Plugin/ AccessTest.php  - Tests that node_access table is joined when hook_node_grants() is implemented.
 
File
- 
              core/
modules/ views/ src/ Views.php, line 123  
Class
- Views
 - Static service container wrapper for views.
 
Namespace
Drupal\viewsCode
public static function getView($id) {
  $view = \Drupal::entityTypeManager()->getStorage('view')
    ->load($id);
  if ($view) {
    return static::executableFactory()->get($view);
  }
  return NULL;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.