You are here

function views_init in Views (for Drupal 7) 8.3

Same name and namespace in other branches
  1. 6.3 views.module \views_init()
  2. 6.2 views.module \views_init()

Implements hook_init().

4 calls to views_init()
JoinManager::__construct in lib/Drupal/views/Plugin/Type/JoinManager.php
Constructs a JoinManager object.
PluginManager::__construct in lib/Drupal/views/Plugin/Type/PluginManager.php
Constructs a PluginManager object.
ViewTestBase::setUp in lib/Drupal/views/Tests/ViewTestBase.php
Sets up a Drupal site for running functional and integration tests.
WizardManager::__construct in lib/Drupal/views/Plugin/Type/WizardManager.php
Constructs a WizardManager object.

File

./views.module, line 59
Primarily Drupal hooks and global API functions to manipulate views.

Code

function views_init() {
  $path = drupal_get_path('module', 'views');
  $loader = drupal_classloader();

  // Just register enabled modules.
  $modules = array_intersect(views_core_modules(), module_list('module_enabled'));
  foreach ($modules as $module) {
    $function = $module . '_views_api';
    if (function_exists($function)) {
      $loader
        ->registerNamespace('Views\\' . $module, DRUPAL_ROOT . '/' . $path . '/lib');
    }
  }
}