Add a relative path to the currently set path
string $relativePath Relative path to add:
public function addPath($relativePath) {
if (!$relativePath || $relativePath == '/') {
return $this;
}
// Add a leading slash if needed
if ($relativePath[0] != '/') {
$relativePath = '/' . $relativePath;
}
return $this
->setPath(str_replace('//', '/', $this
->getPath() . $relativePath));
}