private function getFilename($name)
    {
        if (file_exists($name)) {
            return $name;
        }

        [$plugin, $file] = pluginSplit($name);
        foreach ([null, $plugin] as $scope) {
            $paths = $this->getPaths($scope);
            foreach ($paths as $path) {
                $filePath = $path . $file;
                if (is_file($filePath)) {
                    return $filePath;
                }

                $filePath = $path . $file . TwigView::EXT;
                if (is_file($filePath)) {
                    return $filePath;
                }
            }
        }

        return false;
    }