yii\helpers\BaseStringHelper::dirname PHP Метод

dirname() публичный статический Метод

This method is similar to dirname() except that it will treat both \ and / as directory separators, independent of the operating system.
См. также: http://www.php.net/manual/en/function.basename.php
public static dirname ( string $path ) : string
$path string A path string.
Результат string the parent directory's path.
    public static function dirname($path)
    {
        $pos = mb_strrpos(str_replace('\\', '/', $path), '/');
        if ($pos !== false) {
            return mb_substr($path, 0, $pos);
        } else {
            return '';
        }
    }