protected getRelativePath ( |
||
$rsc | The resource to extract the relative path from, not null. | |
$themePath | string | The theme path, not null. |
return | string | The relative [path in regards with the theme path for the resource. |
protected function getRelativePath(Resource $rsc, $themePath)
{
$path = $rsc->getPath();
$lenght = strlen($themePath);
if (strncmp($path, $themePath, $lenght) != 0) {
throw new \Exception("The resource path '.{$path}.' is not for the provided theme path '.{$themePath}.'.");
}
$path = substr($path, $lenght);
return $path;
}