src/StaticDeploy/Parser/Twig/Extension.php
public function getBasepath($suffix = null)
    {
        $relativeDirectory = '.';

        $givenRelativePath = dirname($this->getCurrentPage());

        if ($givenRelativePath === '/') {
            $givenRelativePath = '';
        }

        $depth = substr_count($givenRelativePath, '/');

        for ($i = 0; $i < $depth; $i++) {
            $relativeDirectory .= '/..';
        }

        if ($suffix) {
            return $relativeDirectory . '/' . $suffix;
        } else {
            return $relativeDirectory;
        }
    }
public function getBasepath($suffix = null)
    {
        $relativeDirectory = '.';

        $givenRelativePath = dirname($this->getCurrentPage());

        if ($givenRelativePath === '/') {
            $givenRelativePath = '';
        }

        $depth = substr_count($givenRelativePath, '/');

        for ($i = 0; $i < $depth; $i++) {
            $relativeDirectory .= '/..';
        }

        if ($suffix) {
            return $relativeDirectory . '/' . $suffix;
        } else {
            return $relativeDirectory;
        }
    }
public function getBasepath ( $ suffix = null ) { $ relativeDirectory = '.' ; $ givenRelativePath = dirname ( $ this -> getCurrentPage ( ) ) ; if ( $ givenRelativePath === '/' ) { $ givenRelativePath = '' ; } $ depth = substr_count ( $ givenRelativePath , '/' ) ; for ( $ i = 0 ; $ i < $ depth ; $ i ++ ) { $ relativeDirectory .= '/..' ; } if ( $ suffix ) { return $ relativeDirectory . '/' . $ suffix ; } else { return $ relativeDirectory ; } }
calculates the relative basepath
@param  string $suffix if a suffix given, it will return basepath + filename, otherwise just the basepath
@return string
calculates the relative basepath