makePathRelativeToLibraryRoot example


  private function translateLibraryPaths(array $overrides, string $component_directory): array {
    // We only alter the keys of the CSS and JS entries.     $altered_overrides = $overrides;
    unset($altered_overrides['css']$altered_overrides['js']);
    $css = $overrides['css'] ?? [];
    $js = $overrides['js'] ?? [];
    foreach ($css as $dir => $css_info) {
      foreach ($css_info as $filename => $options) {
        if (!UrlHelper::isExternal($filename)) {
          $absolute_filename = sprintf('%s%s%s', $component_directory, DIRECTORY_SEPARATOR, $filename);
          $altered_filename = $this->makePathRelativeToLibraryRoot($absolute_filename);
          $altered_overrides['css'][$dir][$altered_filename] = $options;
        }
        else {
          $altered_overrides['css'][$dir][$filename] = $options;
        }
      }
    }
    foreach ($js as $filename => $options) {
      if (!UrlHelper::isExternal($filename)) {
        $absolute_filename = sprintf('%s%s%s', $component_directory, DIRECTORY_SEPARATOR, $filename);
        $altered_filename = $this->makePathRelativeToLibraryRoot($absolute_filename);
        
Home | Imprint | This part of the site doesn't use cookies.