src/TwigExtension/ExtensionLoader.php
static protected function loadAll($type) {
    $theme = \Drupal::config('system.theme')->get('default');
    $themeLocation = drupal_get_path('theme', $theme);
    $themePath = DRUPAL_ROOT . '/' . $themeLocation . '/';

    $extensionPaths = glob($themePath . '*/_twig-components/');

    foreach ($extensionPaths as $extensionPath) {
      $fullPath = $extensionPath;
      foreach (scandir($fullPath . $type) as $file) {
        $fileInfo = pathinfo($file);
        if ($fileInfo['extension'] === 'php') {
          if ($file[0] != '.' && $file[0] != '_' && substr($file, 0, 3) != 'pl_') {
            static::load($type, $fullPath . $type . '/' . $file);
          }
        }
      }
    }
  }
static protected function loadAll($type) {
    $theme = \Drupal::config('system.theme')->get('default');
    $themeLocation = drupal_get_path('theme', $theme);
    $themePath = DRUPAL_ROOT . '/' . $themeLocation . '/';

    $extensionPaths = glob($themePath . '*/_twig-components/');

    foreach ($extensionPaths as $extensionPath) {
      $fullPath = $extensionPath;
      foreach (scandir($fullPath . $type) as $file) {
        $fileInfo = pathinfo($file);
        if ($fileInfo['extension'] === 'php') {
          if ($file[0] != '.' && $file[0] != '_' && substr($file, 0, 3) != 'pl_') {
            static::load($type, $fullPath . $type . '/' . $file);
          }
        }
      }
    }
  }
static protected function loadAll ( $ type ) { $ theme = \ Drupal :: config ( 'system.theme' ) -> get ( 'default' ) ; $ themeLocation = drupal_get_path ( 'theme' , $ theme ) ; $ themePath = DRUPAL_ROOT . '/' . $ themeLocation . '/' ; $ extensionPaths = glob ( $ themePath . '*/_twig-components/' ) ; foreach ( $ extensionPaths as $ extensionPath ) { $ fullPath = $ extensionPath ; foreach ( scandir ( $ fullPath . $ type ) as $ file ) { $ fileInfo = pathinfo ( $ file ) ; if ( $ fileInfo [ 'extension' ] === 'php' ) { if ( $ file [ 0 ] != '.' && $ file [ 0 ] != '_' && substr ( $ file , 0 , 3 ) != 'pl_' ) { static :: load ( $ type , $ fullPath . $ type . '/' . $ file ) ; } } } } }
Loads all plugins of a given type.

This should be called once per $type.

@param string $type
The type to load all plugins for.
Loads all plugins of a given type .