本文整理汇总了PHP中Gantry\Component\Filesystem\Folder::getRelativePathDotDot方法的典型用法代码示例。如果您正苦于以下问题:PHP Folder::getRelativePathDotDot方法的具体用法?PHP Folder::getRelativePathDotDot怎么用?PHP Folder::getRelativePathDotDot使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gantry\Component\Filesystem\Folder
的用法示例。
在下文中一共展示了Folder::getRelativePathDotDot方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: libUrl
public function libUrl(array $args, Compiler $compiler)
{
// Function has a single parameter.
$parsed = reset($args);
if (!$parsed) {
$this->throwError('url() is missing parameter');
}
// Compile parsed value to string.
$url = trim($compiler->compileValue($parsed), '\'"');
// Handle ../ inside CSS files (points to current theme).
$uri = strpos($url, '../') === 0 ? 'gantry-theme://' . substr($url, 3) : $url;
// Generate URL, failed streams will be kept as they are to allow users to find issues.
$url = Document::url($uri) ?: $url;
// Changes absolute URIs to relative to make the path to work even if the site gets moved.
if ($url[0] == '/' && $this->basePath) {
$url = Folder::getRelativePathDotDot($url, $this->basePath);
}
// Return valid CSS.
return "url('{$url}')";
}