Library: Add getters for the different asset paths

This commit is contained in:
Johannes Meyer 2020-11-11 12:19:23 +01:00
parent ad9099509d
commit c49a811fb5

View File

@ -14,6 +14,15 @@ class Library
/** @var string */
protected $path;
/** @var string */
protected $jsAssetPath;
/** @var string */
protected $cssAssetPath;
/** @var string */
protected $staticAssetPath;
/** @var string */
protected $version;
@ -43,6 +52,39 @@ class Library
return $this->path;
}
/**
* Get path of this library's JS assets
*
* @return string
*/
public function getJsAssetPath()
{
$this->assets();
return $this->jsAssetPath;
}
/**
* Get path of this library's CSS assets
*
* @return string
*/
public function getCssAssetPath()
{
$this->assets();
return $this->cssAssetPath;
}
/**
* Get path of this library's static assets
*
* @return string
*/
public function getStaticAssetPath()
{
$this->assets();
return $this->staticAssetPath;
}
/**
* Get this library's name
*
@ -158,6 +200,8 @@ class Library
return [];
}
$this->{$type . 'AssetPath'} = $dir;
return new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
$dir,
RecursiveDirectoryIterator::CURRENT_AS_PATHNAME | RecursiveDirectoryIterator::SKIP_DOTS