src/ActionRequest.php
public function pathToString($path, $rewrite = false)
    {
        if (is_string($path)) {
            return $path;
        }
        $str = $this->basePath;
        if ($str == '/') {
            $str = '';
        }
        if (! ($this->rewrite or $rewrite)) {
            $str .= '/' . $this->scriptName;
        }
        $str .= '/' . implode('/', array_map('urlencode', $path));
        $str = rtrim($str, '/');
        if ($str == '') {
            return '/';
        }
        return $str;
    }
public function pathToString($path, $rewrite = false)
    {
        if (is_string($path)) {
            return $path;
        }
        $str = $this->basePath;
        if ($str == '/') {
            $str = '';
        }
        if (! ($this->rewrite or $rewrite)) {
            $str .= '/' . $this->scriptName;
        }
        $str .= '/' . implode('/', array_map('urlencode', $path));
        $str = rtrim($str, '/');
        if ($str == '') {
            return '/';
        }
        return $str;
    }
public function pathToString ( $ path , $ rewrite = false ) { if ( is_string ( $ path ) ) { return $ path ; } $ str = $ this -> basePath ; if ( $ str == '/' ) { $ str = '' ; } if ( ! ( $ this -> rewrite or $ rewrite ) ) { $ str .= '/' . $ this -> scriptName ; } $ str .= '/' . implode ( '/' , array_map ( 'urlencode' , $ path ) ) ; $ str = rtrim ( $ str , '/' ) ; if ( $ str == '' ) { return '/' ; } return $ str ; }
Convert path array to a string.

@param string|string[] $path Path array or absolute url.
@param bool $rewrite Whether to force removal of script name from path.
@return string Path string.
Convert path array to a string .