src/TwigExtension.php
public function currentPath($withQueryString = false)
    {
        if (is_string($this->uri)) {
            return $this->uri;
        }

        $path = $this->uri->getBasePath() . '/' . ltrim($this->uri->getPath(), '/');

        if ($withQueryString && '' !== $query = $this->uri->getQuery()) {
            $path .= '?' . $query;
        }

        return $path;
    }
public function currentPath($withQueryString = false)
    {
        if (is_string($this->uri)) {
            return $this->uri;
        }

        $path = $this->uri->getBasePath() . '/' . ltrim($this->uri->getPath(), '/');

        if ($withQueryString && '' !== $query = $this->uri->getQuery()) {
            $path .= '?' . $query;
        }

        return $path;
    }
public function currentPath ( $ withQueryString = false ) { if ( is_string ( $ this -> uri ) ) { return $ this -> uri ; } $ path = $ this -> uri -> getBasePath ( ) . '/' . ltrim ( $ this -> uri -> getPath ( ) , '/' ) ; if ( $ withQueryString && '' !== $ query = $ this -> uri -> getQuery ( ) ) { $ path .= '?' . $ query ; } return $ path ; }
Returns current path on given URI.

@param bool $withQueryString
@return string
Returns current path on given URI .