public static function toPath($path, $ext = 'php', $root = '') {
        $ds = static::SEPARATOR;
        $path = static::ds($path);
        $dirs = explode($ds, $path);
        $file = array_pop($dirs);
        $path = implode($ds, $dirs) . $ds . str_replace('_', $ds, $file);

        if ($ext && mb_substr($path, -mb_strlen($ext)) !== $ext) {
            $path .= '.' . $ext;
        }

        if ($root) {
            $path = $root . $path;
        }

        return $path;
    }
public static function toPath($path, $ext = 'php', $root = '') {
        $ds = static::SEPARATOR;
        $path = static::ds($path);
        $dirs = explode($ds, $path);
        $file = array_pop($dirs);
        $path = implode($ds, $dirs) . $ds . str_replace('_', $ds, $file);

        if ($ext && mb_substr($path, -mb_strlen($ext)) !== $ext) {
            $path .= '.' . $ext;
        }

        if ($root) {
            $path = $root . $path;
        }

        return $path;
    }
public static function toPath ( $ path , $ ext = 'php' , $ root = '' ) { $ ds = static :: SEPARATOR ; $ path = static :: ds ( $ path ) ; $ dirs = explode ( $ ds , $ path ) ; $ file = array_pop ( $ dirs ) ; $ path = implode ( $ ds , $ dirs ) . $ ds . str_replace ( '_' , $ ds , $ file ) ; if ( $ ext && mb_substr ( $ path , - mb_strlen ( $ ext ) ) !== $ ext ) { $ path .= '.' . $ ext ; } if ( $ root ) { $ path = $ root . $ path ; } return $ path ; }
Converts a namespace to a relative or absolute file system path.

@param string $path
@param string $ext
@param string $root
@return string
Converts a namespace to a relative or absolute file system path .