You are here

public function PrintableCssInclude::getCssIncludePath in Printer and PDF versions for Drupal 8+ 8

Same name and namespace in other branches
  1. 2.x src/PrintableCssInclude.php \Drupal\printable\PrintableCssInclude::getCssIncludePath()

Get the configured CSS include path for printable pages.

Return value

string The include path, relative to the root of the Drupal install.

Overrides PrintableCssIncludeInterface::getCssIncludePath

File

src/PrintableCssInclude.php, line 43

Class

PrintableCssInclude
Helper class for the printable module.

Namespace

Drupal\printable

Code

public function getCssIncludePath() {
  if ($include_path = $this->configFactory
    ->get('printable.settings')
    ->get('css_include')) {
    if ($token = $this
      ->extractCssIncludeToken($include_path)) {
      list(, $theme) = explode(':', trim($token, '[]'));
      $include_path = str_replace($token, $this
        ->getThemePath($theme), $include_path);
    }
    return $include_path;
  }
}