getCollectionDirectory example

/** * Get folder inside each component that contains the files. * * @param \Drupal\Core\Extension\Extension $extension * The Extension object for the component. * * @return string * The configuration folder name for this component. */
  protected function getComponentFolder(Extension $extension) {
    return $extension->getPath() . '/' . $this->getCollectionDirectory();
  }

  /** * Get folder inside Drupal core that contains the files. * * @return string * The configuration folder name for core. */
  protected function getCoreFolder() {
    return 'core/' . $this->getCollectionDirectory();
  }

  
    // the APCu cache.     $this->fileCache = FileCacheFactory::get('config', ['cache_backend_class' => NULL]);
  }

  /** * Returns the path to the configuration file. * * @return string * The path to the configuration file. */
  public function getFilePath($name) {
    return $this->getCollectionDirectory() . '/' . $name . '.' . static::getFileExtension();
  }

  /** * Returns the file extension used by the file storage for all configuration files. * * @return string * The file extension. */
  public static function getFileExtension() {
    return 'yml';
  }

  
Home | Imprint | This part of the site doesn't use cookies.