drupal_classloader_register

drupal_classloader_register($name, $path)

Registers an additional namespace.

Parameters

string $name: The namespace component to register; e.g., 'node'.

string $path: The relative path to the Drupal component in the filesystem.

File

core/includes/bootstrap.inc, line 762
Functions that need to be loaded on every Drupal request.

Code

function drupal_classloader_register($name, $path) {
  $loader = \Drupal::service('class_loader');
  $loader->addPsr4('Drupal\\' . $name . '\\', \Drupal::root() . '/' . $path . '/src');
}
doc_Drupal
2016-10-29 09:03:10
Comments
Leave a Comment

Please login to continue.